"Accept" header appears to be overridden using setExtraHTTPHeaders, but isn't
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 1.14.0
- Platform / OS version: Laravel Homestead/Ubuntu 4.4.0-66-generic #87
- URLs (if applicable):
- Node.js version: v11.13.0
What steps will reproduce the problem?
await eloquaPage.setExtraHTTPHeaders(
{
'Accept': 'application/json' // also tried 'accept', accept, Accept, "accept", "Accept"
});
// let thisResponse = await page.goto(<url>);
// console.log(thisResponse.request().headers()); <= shows the overridden header, as expected
What is the expected result? Accept => javascript/json
What happens instead? (as logged in a php built-in test server) [accept] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3
I am able to overwrite other headers, and add new headers. If I am doing something wrong, please let me know. I see https://github.com/GoogleChrome/puppeteer/issues/3638 but it was closed without a resolution that I can see.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
849972 - DevTools: Headers overridden with Network ...
Issue 849972: DevTools: Headers overridden with Network.setExtraHTTPHeaders are selectively munged/ignored by the browser.
Read more >URLRequest with Accept header: gets put in request body, not ...
Namely on community.adobe.com , but the requests from SWF there are accompanied both by the Accept header and the POST parameter indicating the ......
Read more >Modifying Headers In HTTP(s) Requests In UI Automation ...
The ability to modify the headers of traffic that pass through your browser is a great tool to have. Besides overriding X-frame-options ,...
Read more >Troubleshooting a failed canary - Amazon CloudWatch
Modifying the request headers by adding a trace header or adding extra headers using Puppeteer's page.setExtraHTTPHeaders causes a CORS check for ...
Read more >BrowserContext | Playwright - CukeTest
If a page opens another page, e.g. with a window.open call, the popup will belong to the parent page's browser context. Playwright allows...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I get the same error. This is how I got around it:
Not sure if related or not but is that the reason why
accept
,accept-language
andaccept-encoding
do not appears when you callrequest.headers()
?I’d like to know which headers where sent but the return of this methods seems incomplete…