question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Headers 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:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Conduitrycommented, Mar 17, 2021

They even used to have a .getAll() that returned an array and decided no that was too helpful.

0reactions
benmccanncommented, Mar 17, 2021

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 case

I think our own Headers definition is the only one that’s broken then. fetch headers can be string, but I think our Request and Response headers are wrong. E.g. consider the set-cookie example in the documentation - with this API you can only set a single cookie

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found