interceptors
interceptors copied to clipboard
Fix response raw headers
The Response
merges the headers, so we don't get the original rawHeaders array.
@kettanaito WDYT?
P.S: I fixed a small error in headers, set-cookie is not an array. (easy fix)
After I thought about it, I think we should add an extra argument or a way to pass the raw headers more straightforwardly.
I think that the rawHeaders
case is an edge case; most users don't care about them very much and use the headers
object.
So, instead of utilizing an internal implementation of Node.js, which may break at some point without notice, we should expose a proper API for this.
I don't think we should "dirty" the withResponse
function for this edge case, but maybe add another function or another solution.
Closing in favor of #598.