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

Request.forwarded_prefix does not include port when not behind reverse proxy #1678

Closed
hackedd opened this issue Feb 19, 2020 · 1 comment
Closed
Labels
Milestone

Comments

@hackedd
Copy link
Contributor

hackedd commented Feb 19, 2020

When using forwarded_prefix to construct absolute URLs, it does not contain the port when the application is not behind a reverse proxy.

This happens because forwarded_prefix uses forwarded_host, which falls back to the host property when the Forwarded and X-Forwarded-Host HTTP headers are not set.

It seems that falling back to netloc (like in prefix) would solve the problem.

@open-collective-bot
Copy link

Hi 👋,

Thanks for using Falcon. The large amount of time and effort needed to
maintain the project and develop new features is not sustainable without
the generous financial support of community members like you.

Please consider helping us secure the future of the Falcon framework with a
one-time or recurring donation.

Thank you for your support!

hackedd added a commit to hackedd/falcon that referenced this issue Feb 20, 2020
Use netloc instead of host in forwarded_host, to correctly reconstruct
the request URI when the proxy headers are not set.
@kgriffs kgriffs added this to the Version 3.0 milestone Feb 26, 2020
@kgriffs kgriffs added the bug label Feb 26, 2020
hackedd added a commit to hackedd/falcon that referenced this issue Feb 26, 2020
Use netloc instead of host in forwarded_host, to correctly reconstruct
the request URI when the proxy headers are not set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants