View Source cowmachine_accept_language (cowmachine v1.12.1)

Accept-Language handling.

Link to this section Summary

Link to this section Functions

Link to this function

accept_header(AvailableLangs, AcceptHeader)

View Source
-spec accept_header(AvailableLangs, AcceptHeader) -> Result
                 when
                     AvailableLangs :: [{binary(), [binary()]}],
                     AcceptHeader :: cowmachine_req:context() | binary() | undefined,
                     Result :: {ok, binary()} | {error, nomatch | header}.
Link to this function

accept_list(AvailableLangs, AcceptableLangs)

View Source
-spec accept_list(AvailableLangs, AcceptableLangs) -> Result
               when
                   AvailableLangs :: [{binary(), [binary()]}],
                   AcceptableLangs :: [binary()],
                   Result :: {ok, binary()} | {error, nomatch}.
Link to this function

parse_header(AcceptHeader)

View Source
-spec parse_header(AcceptHeader) -> Result
                when
                    AcceptHeader :: cowmachine_req:context() | binary() | undefined,
                    Result :: {ok, [binary()]} | {error, nomatch | header}.