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

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

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

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

Conversation

@TheAlexLichter

@TheAlexLichterTheAlexLichter commented Nov 8, 2022

Copy link
Copy Markdown
Member

🔗 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 logoCodeSandbox logo Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify

netlifyBot commented Nov 8, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs ready!

NameLink
🔨 Latest commit1fb6ec2
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/636a479bba6e0d000931c944
😎 Deploy Previewhttps://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 threadpackages/nuxt/src/app/composables/ssr.ts
@TheAlexLichter

TheAlexLichter commented Nov 8, 2022

Copy link
Copy Markdown
MemberAuthor

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

(Before merging, please ensure to add Co-Authored-by to credit @aaharu for the finding 🙏🏻)

pi0
pi0 approved these changes Nov 9, 2022

@pi0pi0 left a comment

Copy link
Copy Markdown
Member

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:mainNov 9, 2022
@TheAlexLichter
TheAlexLichter deleted the fix/use-request-header-casing branch November 9, 2022 09:34
@pi0pi0 mentioned this pull request Nov 15, 2022
Sign up for freeto 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

@TheAlexLichter@aaharu@pi0@danielroe