arizona_cowboy_req (arizona_cowboy v0.1.0)
View SourceCowboy adapter for the arizona_req behaviour.
The raw value is Cowboy's request map. Path bindings are the ones
arizona_route_table matched, stored on the request under Cowboy's own
bindings key (binary names, percent-decoded values), since Cowboy's router
only saw the adapter's catch-all route.
Summary
Functions
Wraps a Cowboy request in an arizona_req:request().
Resolves a navigate target against the routes of the listener that accepted
CowboyReq, matched as a GET (an HTTP/2 WebSocket upgrade is a CONNECT).
error for anything but a live route; never crashes, never replies.
Functions
-spec new(CowboyReq) -> arizona_req:request() when CowboyReq :: cowboy_req:req().
Wraps a Cowboy request in an arizona_req:request().
-spec parse_bindings(cowboy_req:req()) -> arizona_req:bindings().
-spec parse_cookies(cowboy_req:req()) -> arizona_req:cookies().
-spec parse_headers(cowboy_req:req()) -> arizona_req:headers().
-spec parse_params(cowboy_req:req()) -> arizona_req:params().
-spec peer(cowboy_req:req()) -> {inet:ip_address(), inet:port_number()}.
-spec read_body(CowboyReq) -> {ok, arizona_req:body(), CowboyReq} | {error, arizona_req:body_error()} when CowboyReq :: cowboy_req:req().
-spec resolve_route(Path, Qs, CowboyReq) -> {ok, Handler, RouteOpts, ArzReq} | error when Path :: arizona_req:path(), Qs :: arizona_req:qs(), CowboyReq :: cowboy_req:req(), Handler :: module(), RouteOpts :: arizona_live:route_opts(), ArzReq :: arizona_req:request().
Resolves a navigate target against the routes of the listener that accepted
CowboyReq, matched as a GET (an HTTP/2 WebSocket upgrade is a CONNECT).
error for anything but a live route; never crashes, never replies.
-spec scheme(cowboy_req:req()) -> arizona_req:scheme().