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

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

Merged
pi0 merged 3 commits intonuxt:mainfrom
TheAlexLichter:fix/use-request-header-casing
Nov 9, 2022
Merged

fix(ssr): ensure useRequestHeaders are case-insensitive#8805
pi0 merged 3 commits intonuxt:mainfrom
TheAlexLichter:fix/use-request-header-casing

Conversation

@TheAlexLichter
Copy link
Copy Markdown
Member

@TheAlexLichter TheAlexLichter 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
Copy Markdown

codesandbox Bot commented Nov 8, 2022

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

@netlify
Copy link
Copy Markdown

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.

Comment thread packages/nuxt/src/app/composables/ssr.ts
@TheAlexLichter
Copy link
Copy Markdown
Member Author

TheAlexLichter 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
Copy Markdown
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
@TheAlexLichter TheAlexLichter 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.

4 participants