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 disabling of location header autocorrect for werkzeug 2+ #649

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions httpbin/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ def jsonify(*args, **kwargs):


# Prevent WSGI from correcting the casing of the Location header
# and forcing it to be absolute. This moved from BaseResponse to
# Response in werkzeug 2.0.0, so we set both to be safe.
BaseResponse.autocorrect_location_header = False
Response.autocorrect_location_header = False

# Find the correct template folder when running from a different location
tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates")
Expand Down