-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide more request headers when intercepting requests #3436
Comments
@mattzeunert DevTools Protocol network inspection is located quite high in the network stack. This architecture doesn't let us collect all the headers that are added to the requests. So the ones we report in There are a few ways to get real request headers:
Let me know if this somehow helps. |
Thanks @aslushnikov! The idea was to do the request myself in Node rather than letting Chrome do it. So I can't wait for the I'm going to use a proxy for now. |
@mattzeunert yeah I see; hope it'll work out nicely. |
@aslushnikov using the new chrome v73 Network.responseReceived does not contain requestHeaders, only the first request have it. using --disable-site-isolation-trials --disable-features=IsolateOrigins,site-per-process --disable-web-security have no effect too. |
When a request from the example code below is intercepted, the following request headers are available (same as in requestWillBeSent):
But these are the full request headers that Chrome uses when making the request:
Some of those depend on how the actual request is made by Chrome, but these don't:
Cookie
(currently I'm generating this by using the cookie API)Accept
(it's probably possible to find a sensible value for this based on the request type)My end goal would be that I can make the request myself and it will have the same end result as if Chrome had made the request. (So even headers like
Accept-Encoding
would be helpful.)The specific problem I've been debugging is that the backend I'm working with was sending different response content based on the value of the
Accept
header.Example code:
The text was updated successfully, but these errors were encountered: