Skip to content

Run iri_to_uri on header values #11439

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

Merged
merged 3 commits into from
Jun 25, 2024
Merged

Run iri_to_uri on header values #11439

merged 3 commits into from
Jun 25, 2024

Conversation

ericholscher
Copy link
Member

This fixes #11403

@ericholscher ericholscher requested a review from a team as a code owner June 25, 2024 16:12
@ericholscher ericholscher requested a review from humitos June 25, 2024 16:12
@ericholscher
Copy link
Member Author

ericholscher commented Jun 25, 2024

@stsewd hrm, this is now breaking another test because it's adding X-RTD-Resolver-Filename in a place where it wasn't before, because presumably now it isn't invalid. That seems fine?

         self.assertNotIn("X-RTD-Resolver-Filename", r.headers)
         AssertionError: 'X-RTD-Resolver-Filename' unexpectedly found in {'Content-Type': 'text/html; charset=utf-8', 'Location': 'http://project.dev.readthedocs.io//example.com/path.html', 'X-RTD-Redirect': 'user', 'X-RTD-Domain': 'project.dev.readthedocs.io', 'X-RTD-Project': 'project', 'X-RTD-Version': 'latest', 'Cache-Tag': 'project,project:latest', 'X-RTD-Project-Method': 'public_domain', 'X-RTD-Version-Method': 'path', 'CDN-Cache-Control': 'public', 'X-RTD-Resolver-Filename': '/en/latest/%0D/example.com/path.html', 'access-control-allow-origin': '*', 'access-control-allow-methods': 'HEAD, OPTIONS, GET', 'Referrer-Policy': 'no-referrer-when-downgrade', 'X-Content-Type-Options': 'nosniff', 'Cross-Origin-Opener-Policy': 'same-origin', 'Content-Length': '0', 'Vary': 'Accept-Language, Cookie', 'Content-Language': 'en'}

@stsewd
Copy link
Member

stsewd commented Jun 25, 2024

@ericholscher yeah, should be fine. We can probably also remove the call to ResponseHeaders({})._convert_to_charset now.

@ericholscher ericholscher merged commit 1396849 into main Jun 25, 2024
7 checks passed
@ericholscher ericholscher deleted the fix-11403 branch June 25, 2024 20:12
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.

Flyout: unicode characters break URLs in flyout
2 participants