Plug Locale Root Redirect v0.3.1 PlugLocaleRootRedirect View Source

A Plug that uses PlugBest to map '/' route to a path based on the Accept-Language HTTP header.

Link to this section Summary

Functions

Call the plug

Initialize the plug with a list of supported locales

Link to this section Types

Link to this type

language() View Source
language() :: {String.t(), String.t(), float()}

Link to this type

opts() View Source
opts() ::
  binary()
  | tuple()
  | atom()
  | integer()
  | float()
  | [opts()]
  | %{optional(opts()) => opts()}

Link to this section Functions

Link to this function

call(conn, locales) View Source
call(Plug.Conn.t(), [atom()]) :: Plug.Conn.t()

Call the plug.

Initialize the plug with a list of supported locales.

Link to this function

sanitize_empty_query(uri) View Source
sanitize_empty_query(%URI{
  authority: term(),
  fragment: term(),
  host: term(),
  path: term(),
  port: term(),
  query: term(),
  scheme: term(),
  userinfo: term()
}) :: %URI{
  authority: term(),
  fragment: term(),
  host: term(),
  path: term(),
  port: term(),
  query: term(),
  scheme: term(),
  userinfo: term()
}