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

Conversation

Projects
None yet
2 participants
@c-w
Copy link
Contributor

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

Fix redirects when hosted at a non-root location
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
@Sumukh

Sumukh approved these changes Jul 6, 2018

@c-w c-w merged commit 5339ea1 into okpy:master Jul 9, 2018

3 checks passed

Travis CI - Pull Request Build Passed
Details
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@c-w c-w deleted the c-w:bug/c-w/fix-redirect-url-non-root-host branch Jul 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.