When upgrading @mswjs/interceptors to 0.33 (in https://github.com/mswjs/msw/pull/2011), I've noticed a failing mocked binary response test: it was listing the Content-Length header value twice
Content-Length: 1044, 1044
[!WARNING]
This indicates a deeper issue, as .set() on Headers instance must not join values. Something goes off here. Raw Headers from Undici behaved correctly on that branch.
We don't have any check if the Content-Length response header has already been set on HttpResponse.arrayBuffer(), which means MSW will disregard your custom Content-Length, which is a bug.
When upgrading @mswjs/interceptors to 0.33 (in https://github.com/mswjs/msw/pull/2011), I've noticed a failing mocked binary response test: it was listing the
Content-Length
header value twiceWe don't have any check if the
Content-Length
response header has already been set onHttpResponse.arrayBuffer()
, which means MSW will disregard your customContent-Length
, which is a bug.