Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(ssr): ensure useRequestHeaders are case-insensitive #8805

Merged
merged 3 commits into from Nov 9, 2022

Conversation

manniL
Copy link
Member

@manniL manniL commented Nov 8, 2022

πŸ”— Linked issue

https://github.com/nuxt/framework/discussions/8803

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Makes headers case-insensitive.

Would be good to double-check if headers always come lower-cased from the server. If no, maybe add a transform step there too.
https://github.com/unjs/h3/blob/6beee463d0e95207480acfd21badc2c2fa46f6c3/src/utils/request.ts#L58-L65 does not handle casing. Should I create a PR or an issue there too?

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox
Copy link

codesandbox bot commented Nov 8, 2022

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Nov 8, 2022

βœ… Deploy Preview for nuxt3-docs ready!

Name Link
πŸ”¨ Latest commit 1fb6ec2
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/636a479bba6e0d000931c944
😎 Deploy Preview https://deploy-preview-8805--nuxt3-docs.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.

@manniL
Copy link
Member Author

manniL commented Nov 8, 2022

Oh well, that was easy. Thanks @danielroe ☺️

(Before merging, please ensure to add Co-Authored-by to credit @aaharu for the finding πŸ™πŸ»)

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

LGTM. We might also update this utility with new h3.useRequestHeaders that does the normalization

@pi0 pi0 merged commit 0cf0f59 into nuxt:main Nov 9, 2022
@manniL manniL deleted the fix/use-request-header-casing branch November 9, 2022 09:34
@pi0 pi0 mentioned this pull request Nov 15, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants