-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix: Duplicate Content-Type header when Content-Type header is capitalized. #154
Fix: Duplicate Content-Type header when Content-Type header is capitalized. #154
Conversation
…ent-Type header in request object.
@JustinSomers: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor nitpicks, overall looks good to me!
Can you please add a patch changeset (via the npx changeset
command) with a brief description of the user-facing impact this change has? (what does it fix)
Thank you!
I'm usually able to trigger a Circle CI run on forks by pushing an empty commit, but that doesn't seem to be working. I opened a separate branch (which I'll be deleting) just to see CI pass. |
When a
Content-Type
header exists in aincomingRequest
object that is passed into thefetch
function, we will receive a duplicate lowercasecontent-type
header.Here is where the error occurs in the source code
What my proposed change does is it checks for the capitalized
Content-Type
header, if it exists we create a lowercasecontent-type
header and delete the capitalized one.Alternatively, we could just change the above if statement to: