The context module needs to be easily modified so that middleware can add/read headers, modify the body, and anything else they need to do, and to allow route handlers to get cookies and query parameters.
Example
pub fn handler(ctx: Context) -> Response{
let cookie = ctx
|> context.get_cookie(cookie_name)
let header_value = ctx
|> context.get_header(header_name)
let query_param = ctx
|> context.get_query_param(query_name)
...
}
Description
The
context
module needs to be easily modified so that middleware can add/read headers, modify the body, and anything else they need to do, and to allow route handlers to get cookies and query parameters.Example