okpy / ok

ok.py supports programming projects by running tests, tracking progress, and assisting in debugging.
Apache License 2.0
335 stars 84 forks source link

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

Closed c-w closed 6 years ago

c-w commented 6 years ago

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