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

feat(graphql): forces http header value to be lowercase #1237

Merged

Conversation

jeremyfiel
Copy link
Contributor

@jeremyfiel jeremyfiel commented Jan 16, 2024

While RFC2616 indicates http header field names are case insensitive, it leaves http header field values more open to interpretation, such as using the text

Applications ought to follow "common form", where one is known or
indicated, when generating HTTP constructs, since there might exist some implementations that fail to accept anything beyond the common forms.

This is a small user experience improvement for REST Client users to prevent a negative experience by using a case sensitive value.

This is also consistent with the current code snippet for getHeader method which forces lowercase on the http header fields.

const headerName = Object.keys(headers).find(h => h.toLowerCase() === name.toLowerCase());

fixes #1236

While RFC2616 indicates http header field `names` are case insensitive,
it leaves http header field `values` more open to interpretation,
such as using the text

> Applications ought to follow "common form", where one is known or
indicated, when generating HTTP constructs, since there might exist
some implementations that fail to accept anything beyond the common forms.

This is a small user experience improvement for REST Client users
to prevent a negative experience by using a case sensitive value.

fixes Huachao#1236
@Huachao Huachao merged commit 0d290ef into Huachao:master May 10, 2024
@jeremyfiel jeremyfiel deleted the feat/gql-header-value-sensitivity branch August 20, 2024 02:59
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.

Force HTTP headers to be case insensitive
2 participants