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

Fix redirects when hosted at a non-root location #1310

Merged
merged 2 commits into from
Jul 9, 2018
Merged

Fix redirects when hosted at a non-root location #1310

merged 2 commits into from
Jul 9, 2018

Conversation

c-w
Copy link
Contributor

@c-w c-w commented Jul 5, 2018

This issue was found by @taupalosaurus.

The request.full_path field does not contain any hosting prefixes as
set by APPLICATION_ROOT and SCRIPT_NAME so redirects fail when the
application is not hosted at the root location. Using the request.url
field instead fixes the redirects. There's a nice comparison of the
various request URL parts here: https://stackoverflow.com/a/46176337

The `request.full_path` field does not contain any hosting prefixes as
set by `APPLICATION_ROOT` and `SCRIPT_NAME` so redirects fail when the
application is not hosted at the root location. Using the `request.url`
field instead fixes the redirects. There's a nice comparison of the
various request URL parts here: https://stackoverflow.com/a/46176337
@c-w c-w merged commit 5339ea1 into okpy:master Jul 9, 2018
@c-w c-w deleted the bug/c-w/fix-redirect-url-non-root-host branch July 9, 2018 13:45
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