Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): automatically extract forwarded-for header #2007

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

deer
Copy link
Contributor

@deer deer commented Nov 5, 2023

closes #1827
Or rather, the discussion that happens later in the issue.

This change modifies the call to Deno.serve to automatically extract the X-Forwarded-For header, if it exists. This is then available in HandlerContext, MiddlewareHandlerContext, and RouteContext.

@deer
Copy link
Contributor Author

deer commented Nov 6, 2023

@marvinhagemeister, based on #1827 (comment) I guess I should close this. Before I do though: do you see any value in having the handler passed to Deno.serve configurable/overridable? If not, I'll close it. If yes, I can rework this.

Right now I don't see any way of controlling middleware execution order, so if someone absolutely needs something to run first, they're out of luck. Being able to override the Deno.serve handler and having the ability to order middleware (especially from plugins) seems like it would increase flexibility. I can open a separate issue for middleware ordering if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add connInfo in custom handlers
1 participant