-
Notifications
You must be signed in to change notification settings - Fork 16
Request headers #71
Copy link
Copy link
Open
Description
Hi!
As far as I can tell, there is no way to access request headers.
This makes many tasks difficult, e.g. Bearer-tokens.
I propose a solutions where headers are available on the Context-object,
as a Map or [string, string][]. This could be achieved by accessing req.headers
and attaching it to the context.
To clarify, my proposal leads to the following usage:
get("path/to/resource/:id", ({ headers}) => {
const value = headers.get("header-key");
return `${value} was found on 'header-key'!`
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels