maxwell v2.2.2 Maxwell.Middleware.HeaderCase

Forces all request headers to be of a certain case.

Examples

# Lower
iex> conn = %Maxwell.Conn{req_headers: %{"content-type" => "application/json}}
...> Maxwell.Middleware.HeaderCase.request(conn, :lower)
%Maxwell.Conn{req_headers: %{"content-type" => "application/json}}

# Upper
iex> conn = %Maxwell.Conn{req_headers: %{"content-type" => "application/json}}
...> Maxwell.Middleware.HeaderCase.request(conn, :upper)
%Maxwell.Conn{req_headers: %{"CONTENT-TYPE" => "application/json}}

# Title
iex> conn = %Maxwell.Conn{req_headers: %{"content-type" => "application/json}}
...> Maxwell.Middleware.HeaderCase.request(conn, :title)
%Maxwell.Conn{req_headers: %{"Content-Type" => "application/json}}

Summary

Functions

init(casing)
request(conn, atom)