Skip to content

Commit

Permalink
feat(graphql): forces http header value to be lowercase (#1237)
Browse files Browse the repository at this point in the history
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 #1236
  • Loading branch information
jeremyfiel authored May 10, 2024
1 parent a89f8bc commit 0d290ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/httpRequestParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class HttpRequestParser implements RequestParser {
removeHeader(headers, 'content-length');

// check request type
const isGraphQlRequest = getHeader(headers, 'X-Request-Type') === 'GraphQL';
const isGraphQlRequest = getHeader(headers, 'X-Request-Type') === 'GraphQL'.toLowerCase();
if (isGraphQlRequest) {
removeHeader(headers, 'X-Request-Type');

Expand Down

0 comments on commit 0d290ef

Please sign in to comment.