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 Cloudflare Workers usage re:Headers weirdness #214

Merged
merged 3 commits into from
Jun 7, 2023

Conversation

trevor-scheer
Copy link
Member

Ref: apollo-server-integrations/apollo-server-integration-cloudflare-workers#37

After some quick debugging with the example provided in the linked issue, I was able to see that CF's response.headers object was passing the instanceof check for node-fetch's Headers class, but it didn't have the .raw() method we expected on it. This change adds an extra check for existence of the raw method to be sure its there before we try to call it.

I can't explain the instanceof weirdness and not going to dig into it too deeply.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 7, 2023

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.

@trevor-scheer trevor-scheer merged commit c7b190a into main Jun 7, 2023
@trevor-scheer trevor-scheer deleted the trevor/fix-headers-cfw branch June 7, 2023 20:18
@github-actions github-actions bot mentioned this pull request Jun 7, 2023
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.

1 participant