interceptors icon indicating copy to clipboard operation
interceptors copied to clipboard

Fix response raw headers

Open mikicho opened this issue 1 year ago • 1 comments

The Response merges the headers, so we don't get the original rawHeaders array. image

@kettanaito WDYT?

P.S: I fixed a small error in headers, set-cookie is not an array. (easy fix)

mikicho avatar Nov 24 '23 12:11 mikicho

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.

mikicho avatar Dec 18 '23 20:12 mikicho

Closing in favor of #598.

kettanaito avatar Jul 06 '24 13:07 kettanaito