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

Construct URLs with url_for instead of requiring baseURL #1

Merged
merged 1 commit into from
Feb 22, 2020

Conversation

dbnicholson
Copy link
Contributor

Flask provides the url_for helper to construct URLs to endpoint
functions. Any arguments that aren't handled by the method are appended
as query arguments. An absolute URL is constructed when _external is
True. The server address and protocol are properly detected current
request or a proxied request so long as the reverse proxy properly
forwards the Host and X-Forwarded-Proto headers. After this baseURL is
not needed, which simplifies the configuration by taking the hostname
out of the picture.

Flask provides the url_for helper to construct URLs to endpoint
functions. Any arguments that aren't handled by the method are appended
as query arguments. An absolute URL is constructed when _external is
True. The server address and protocol are properly detected from the
current request. This includes a proxied request so long as the reverse
proxy properly forwards the Host and X-Forwarded-Proto headers. After
this baseURL is not needed, which simplifies the configuration by taking
the hostname out of the picture.
@alexlarsson alexlarsson merged commit 14c132e into alexlarsson:master Feb 22, 2020
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.

2 participants