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

deprecate safe_conversion parameter of iri_to_uri #2609

Closed
davidism opened this issue Mar 3, 2023 · 0 comments
Closed

deprecate safe_conversion parameter of iri_to_uri #2609

davidism opened this issue Mar 3, 2023 · 0 comments
Milestone

Comments

@davidism
Copy link
Member

davidism commented Mar 3, 2023

iri_to_uri has a safe_conversion parameter that returns the URL unchanged if it's only ASCII without spaces. This gets used in redirect and Response.get_wsgi_headers. The reason it exists is because urlunsplit sometimes skips adding // after scheme:. The two examples given were magnet:, which doesn't seem to demonstrate the issue, and itms-services:, which has no public spec and doesn't even appear to be an actively used Apple URL scheme.

If it turns out that this somehow breaks a real use case, I think the best course of action is to make it possible to disable the normalization in Response.get_wsgi_headers. Unfortunately, there's already an autocorrect_location_header attribute that means "make the URL absolute". We could try to think of another name, or figure out a way to repurpose the existing attribute name. Or better yet, get the issue fixed in urlunsplit instead.

Was going to write this as a PR, but accidentally merged instead of pushed the PR, so it's already in c3b26d0.

@davidism davidism added this to the 2.3.0 milestone Mar 3, 2023
@davidism davidism closed this as completed Mar 3, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant