The current way to check headers is in the line of
let header = context
.hyper_request
.as_ref()
.unwrap()
.request
.headers()
.get("Origin");
Which for a commonly used section of the request feels long.
An easier way to read the headers (like the context.content_type("application/json"); to set a custom outbound header) would lower the entrance bar for new people trying thruster for use as a server.
Request
A method to access headers, for example a HeadersMap context.header() so users can .get("HeaderKey") or even context.header("headerKey"), for example to get header "Autorization" or any from http::header
Add a new example using it, or include it in an already made example.
The current way to check headers is in the line of
Which for a commonly used section of the request feels long.
An easier way to read the headers (like the
context.content_type("application/json");
to set a custom outbound header) would lower the entrance bar for new people trying thruster for use as a server.Request
context.header()
so users can.get("HeaderKey")
or evencontext.header("headerKey")
, for example to get header "Autorization" or any fromhttp::header