Headers cleanup
See original GitHub issueHeaders type is defined in three places:
- SvelteKit
- Node.js
node-fetch
We try to pass these around interchangeably, but that’s almost certainly broken since it may be a string | string[]
in Node.js, but not in the other two places.
I believe that Node.js has defined headers correctly while the other two are broken. There’s actually an open issue for this in the node-fetch
repo https://github.com/node-fetch/node-fetch/issues/771. Unfortunately, I’m not quite sure what to do about this as long as that issue remains open
I think it’s also possible that fetch
headers are different than generic request headers? In which case, maybe it’s just SvelteKit that’s broken and the other two are both correct
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Cleanup C++/C headers - GitHub
Cleanup C++/C headers. This simple script helps in removing unnecessary includes from C/C++ files. A huge code base or legacy code usually means...
Read more >Cleaning up Headers in Email - HelpMeRick.com
Cleaning up Headers in Email · 1. Start your Email session as normal · 2. Keep your email open, but now Click on...
Read more >How to Polish Exhaust Headers | YourMechanic Advice
It may be best to take the exhaust header outdoors for easy cleanup and the use of a water hose. Step 7: Apply...
Read more >How to cleanup WordPress header and gain speed
How to cleanup WordPress header? This tutorial provides you with snippets (code examples) of the most common WordPress header optimizations ...
Read more >Question #701016 “Clean up linux header files”
I am facing some issues while cleaning up linux header files. The files are eating up a lot of disk space which I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
They even used to have a
.getAll()
that returned an array and decided no that was too helpful.Ah, yeah, you’re right about that: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie. So I guess the
node-fetch
API probably is correct for that use caseI think our own
Headers
definition is the only one that’s broken then.fetch
headers can bestring
, but I think ourRequest
andResponse
headers are wrong. E.g. consider theset-cookie
example in the documentation - with this API you can only set a single cookie