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

Handle Werkzeug 2.1.0 change to Response.autocorrect_location_header. #427

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stacywsmith
Copy link
Contributor

Fixes #426

pallets/werkzeug#2352 changed the default value of Response.autocorrect_location_header from True to False in Werkzeug >= 2.1.0.

tests/legacy/test_api_legacy.py::APITest::test_redirect depended upon Response.autocorrect_location_header being True.

Change test_redirect() to explicitly set Response.autocorrect_location_header to False, for backwards compatibility, and change the expected result for the test from an absolute URL to the relative URL.

Fixes python-restx#426

pallets/werkzeug#2352 changed the default value of Response.autocorrect_location_header from True to False in Werkzeug >= 2.1.0.

tests/legacy/test_api_legacy.py::APITest::test_redirect depended upon Response.autocorrect_location_header being True.

Change `test_redirect()` to explicitly set `Response.autocorrect_location_header` to `False`, for backwards compatibility, and change the expected result for the test from an absolute URL to the relative URL.
Copy link

@jayvdb jayvdb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is used as a patch for https://build.opensuse.org/package/show/devel:languages:python:flask/python-flask-restx to allow building on rolling release Tumbleweed

@ziirish ziirish force-pushed the master branch 2 times, most recently from 0db7d06 to 4eaf373 Compare November 1, 2022 17:47
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.

Change to Response.autocorrect_location_header in Werkzeug 2.1.0 causing test failure.
2 participants