-
Notifications
You must be signed in to change notification settings - Fork 19
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
Support Flask 3.0 #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good fix. I wasn't aware of the details for .helpers.
response = app.make_response("") | ||
response.status_code = 302 | ||
if "status_code" in args: | ||
status_code = int(args["status_code"]) | ||
if status_code >= 300 and status_code < 400: | ||
response.status_code = status_code | ||
response.headers["Location"] = args["url"].encode("utf-8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this issue resolved in a later version of werkzeug? I am curious to understand why it is no longer necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's covered in item 3 in the PR overview. Was there something more specific you were wondering about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, thanks for pointing that out.
This PR should get httpbin working with Flask 3.0. The other recent changes to get Flask 2.0 working in
main
already broke Flask<2.2.4 so I've updated the dependencies to correctly reflect what we're compatible with. This should also resolve #28.This PR changes three primary pieces:
Authorization.from_header
which was introduced in werkzeug 2.3 and is the only supported interface in werkzeug 3.0.parse_authorization_header
was already an alias for this in versions of werkzeug we support.str
so we ensured they wereutf-8
bytes. werkzeug stopped this conversion in 3.0 and we already have a Python 3utf-8
string as input. We should be able drop this safely with our support range.