net.request is losing custom headers from webRequest #27894
Labels
10-x-y
blocked/need-repro
Needs a test case to reproduce the bug
bug 🪲
component/net
platform/windows
Preflight Checklist
Issue Details
10.1.7
Windows 10 Enterprise 1909
When making a request with
net.request
, I can see (and modify) the headers received inelectron.session.defaultSession.webRequest.onHeadersReceived
.But by the time the
net.request
request.on('response')
handler receives the headers, my custom header is gone.I haven't tested if this is an issue in all types of responses, but I can tell you this is occurring without fail for the case when the
response.statusCode === 200
, but theresponse.headers.status === 304
.Expected Behavior
For
net.request
response handler to receive the same headers that are shipped out bywebRequest.onHeadersReceived
handler.Actual Behavior
net.request
response handler is receiving what seems to be a cached set of headers (or something?), which do not match what is sent out inwebRequest.onHeadersReceived
.To Reproduce
Find/get a response from an API where the
statusCode
of the response is200
, but the headers.status is304
.Modify the
headers
inwebRequest.onHeadersReceived
.Observe the
headers
received bynet.request
response handler are completely different.The text was updated successfully, but these errors were encountered: