Skip to content

fix: better headers.getAll polyfill #1801

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

Merged
merged 1 commit into from
Nov 22, 2022
Merged

fix: better headers.getAll polyfill #1801

merged 1 commit into from
Nov 22, 2022

Conversation

ascorbic
Copy link
Contributor

Summary

Last week I added a polyfill for headers.getAll. However Next.js has now added a check to the edge function return value to see if it's an instanceof Response. This means that our polyfilled version wouldn;t match if the user returned e.g. Response.redirect, or fetch(). This PR changes the polyfill from a subclass to augmenting the prototype of Headers. 😬

Test plan

This was caught by the e2e tests PR, but it can be checked for regression by looking at the middleware deploy preview

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

capy gamer

Standard checks:

  • Check the Deploy Preview's Demo site for your PR's functionality
  • Add docs when necessary

🧪 Once merged, make sure to update the version if needed and that it was published correctly.

@ascorbic ascorbic requested a review from a team November 22, 2022 17:42
@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

Name Link
🔨 Latest commit be6a5c1
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/637d0a185603450009de0fa7
😎 Deploy Preview https://deploy-preview-1801--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit be6a5c1
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/637d0a189e51e3000adcbf04
😎 Deploy Preview https://deploy-preview-1801--netlify-plugin-nextjs-export-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit be6a5c1
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/637d0a18b66b0800089c8baa
😎 Deploy Preview https://deploy-preview-1801--next-plugin-canary.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

Name Link
🔨 Latest commit be6a5c1
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/637d0a185da8d80008a02eff
😎 Deploy Preview https://deploy-preview-1801--netlify-plugin-nextjs-static-root-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit be6a5c1
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/637d0a1877d1f50009e78f22
😎 Deploy Preview https://deploy-preview-1801--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for nextjs-plugin-custom-routes-demo failed.

Name Link
🔨 Latest commit be6a5c1
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/637d0a18e95c4d0008df0c65

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit be6a5c1
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/637d0a189ad8c10009742220
😎 Deploy Preview https://deploy-preview-1801--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit be6a5c1
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/637d0a18225eb400087a51b8
😎 Deploy Preview https://deploy-preview-1801--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit be6a5c1
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/637d0a186486f60008ab6c26
😎 Deploy Preview https://deploy-preview-1801--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Nov 22, 2022
Copy link

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and the middleware deploy preview page for cookie looks good as well. 🚀

@kodiakhq kodiakhq bot merged commit 84579c1 into main Nov 22, 2022
@kodiakhq kodiakhq bot deleted the mk/headers-getall2 branch November 22, 2022 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants