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

Remove undefined HTTP headers from TRPCClient #1713

Merged
merged 6 commits into from
Mar 31, 2022
Merged

Conversation

jlalmes
Copy link
Contributor

@jlalmes jlalmes commented Mar 29, 2022

Closes: #1712

Remove undefined HTTP headers from TRPCClient

Added a transform to delete headers with undefined values before HTTP requests are sent by the TRPCClient.

{ "x-defined": "xyz", "x-undefined": undefined } 
// is transformed to
{ "x-defined": "xyz" }

Changes

  • Added headers transformer to httpRequest method
  • Removed undefined typing from HTTPHeaders record
  • Added test case for removing undefined headers
  • Updated @trpc/client imports to relative path in tests
     

@jlalmes jlalmes requested a review from KATT March 29, 2022 16:40
@vercel
Copy link

vercel bot commented Mar 29, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

next-prisma-starter – ./examples/next-prisma-starter

🔍 Inspect: https://vercel.com/trpc/next-prisma-starter/EHRxiiLu4rgz3CMhHbkUAwS7XhRm
✅ Preview: https://next-prisma-starter-git-bugfix-issue-1712-trpc.vercel.app

www – ./www

🔍 Inspect: https://vercel.com/trpc/www/BaCQNWi7L37PRi3QNcqzU4kMsWa9
✅ Preview: https://www-git-bugfix-issue-1712-trpc.vercel.app

@jlalmes jlalmes enabled auto-merge (squash) March 29, 2022 16:40
@github-actions
Copy link

github-actions bot commented Oct 6, 2022

This pull request has been locked because it had no new activity for 30 days. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update HTTP headers handling of undefined
3 participants