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

Convert HTML header field names to lowercase for HTTP2 #5840

Closed

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Nov 9, 2021

HTTP2 requires that header field names be lowercase ss discussed at
https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2 and #5789 (comment)

Technical

Testing

Screenshot

Stakeholders

@cclauss cclauss force-pushed the lowercase-headers-for-http2 branch from 1d99261 to 559bd14 Compare November 9, 2021 17:18
return web.HTTPError(
"401 Authorization Required",
{
"www-authenticate": 'Basic realm="http://openlibrary.org"',
Copy link
Member

Choose a reason for hiding this comment

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

In some places above we've changed Basic -> basic

There are several other locations here where we don't make that change

https://github.com/internetarchive/openlibrary/pull/5840/files#diff-fefad9036d5577fbc4e634459d3638bae0e47a93269b28302f90c660b276cc7bL37

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! Thanks.

openlibrary/core/civicrm.py Outdated Show resolved Hide resolved
openlibrary/core/civicrm.py Outdated Show resolved Hide resolved
return web.HTTPError(
"401 Authorization Required",
{
"www-authenticate": 'Basic realm="http://openlibrary.org"',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! Thanks.

@@ -14,7 +14,7 @@ msgstr ""
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: cs <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"content-type: text/plain; charset=utf-8\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think that Content-Type should be changed in any of the .po files. This header entry is used by gettext, and I can't find any guidance regarding case sensitivity of header entries. Better safe than sorry.

@cdrini
Copy link
Collaborator

cdrini commented Nov 11, 2021

I'm of the mind we should close this ; it's a pretty big potentially risky change to fix an issue that we haven't observed on the site. This sort of PR is actually exactly what I was trying to avoid by posting #5418 (comment) and #5789 (comment) . I imagine case sensitivity is handled at a lower level by requests or web.py , which is why we haven't seen any issues. Changing all these strings in a semi-automatic fashion seems like more risk than it's worth. And the time it'll take for CR and QA and the potential time it'll take to fix if something goes wrong makes this a net loss for me, I'm afraid.

Sorry for the run-around, @cclauss ; I thought we were on the same page!

@cclauss cclauss closed this Nov 11, 2021
@cclauss cclauss deleted the lowercase-headers-for-http2 branch November 11, 2021 21:06
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.

4 participants