Uniquify multiple headers of the same name or something? #88
-
Hi there, Suppose I want to have a global middleware that sets a specific Cache-Control header for all requests (thus acting like a default value), but then down the line some more specific routes may set their own Cache-Control headers, how would I go about achieving those routes to only end up with the last set Cache-Control header? From what I can tell, it was intentional to allow multiple headers of the same name (?) hyper-express/src/components/http/Response.js Lines 172 to 173 in fb447d1 ExpressJS, at least v4.x, will only keep the last set one, so this is a bit of an unexpected behavior for me |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I'm not sure If I fully understand the expected behavior from your post. If the |
Beta Was this translation helpful? Give feedback.
I'm not sure If I fully understand the expected behavior from your post. If the
header()
call was to use the last set value of a header (essentially replacing/ignoring previous values) then how would multiple middlewares be able to write multiple cookies with theset-cookie
header during the lifetime of a request?