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

Fix header class detection #119

Merged
merged 1 commit into from
Oct 5, 2022
Merged

Conversation

ecl1ps
Copy link
Contributor

@ecl1ps ecl1ps commented Oct 4, 2022

When you create a new object by using Object.create(null) then this new instance doesn't inherit from anything. It means Object.create(null).constructor === undefined (https://stackoverflow.com/a/15518712/14750967). And that is the error we are encountering and this PR is fixing.

That is the way how apollo/client@3.7 is preparing headers which are then passed to axios-fetch https://github.com/apollographql/apollo-client/blob/9134aaf3b6fc398b2d82439b5b63848b533ae4c9/src/link/http/selectHttpOptionsAndBody.ts#L203.

This is a regression caused by the following cleanup commit 33d6962.

Added test to reproduce this problem.

@loscm loscm requested a review from bishopb October 4, 2022 12:00
@loscm
Copy link
Contributor

loscm commented Oct 4, 2022

Requested review from a random @lifeomic/security team member, @bishopb, due to term: regression.

This review is not blocking and is for broader awareness. Consider if this change requires deeper security review and ask when it is necessary.

@mdlavin mdlavin self-requested a review October 4, 2022 13:15
@mdlavin mdlavin self-assigned this Oct 4, 2022
@mdlavin
Copy link
Member

mdlavin commented Oct 4, 2022

Thank you for your contribution! It's perfect ❤️ . Clear description, fix and a testcase. I'm running the tests now and I'll merge when it passes

@mdlavin
Copy link
Member

mdlavin commented Oct 4, 2022

Oh bummer. I forgot we require commit signing. @ecl1ps any chance you could force push a signed commit with the same change?

@ecl1ps
Copy link
Contributor Author

ecl1ps commented Oct 5, 2022

Done, signed. But it seems I am too late :D

@mdlavin
Copy link
Member

mdlavin commented Oct 5, 2022

Your change was so good, and I couple other people reported it. I cheated and merged without a signature. Thanks again

@ecl1ps
Copy link
Contributor Author

ecl1ps commented Oct 5, 2022

Glad to help

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.

None yet

3 participants