mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(network): relax request matching heuristic (#3775)
Drop requirement for matching "origin" and "content-type" headers in requests and request interceptions. This way javascript redirects that use form submission start working. Fix #3684.
This commit is contained in:
@@ -651,6 +651,8 @@ class Response {
|
||||
}
|
||||
helper.tracePublicAPI(Response);
|
||||
|
||||
const IGNORED_HEADERS = new Set(['accept', 'referer', 'x-devtools-emulate-network-conditions-client-id', 'cookie', 'origin', 'content-type']);
|
||||
|
||||
/**
|
||||
* @param {!Protocol.Network.Request} request
|
||||
* @return {string}
|
||||
@@ -677,7 +679,7 @@ function generateRequestHash(request) {
|
||||
for (let header of headers) {
|
||||
const headerValue = request.headers[header];
|
||||
header = header.toLowerCase();
|
||||
if (header === 'accept' || header === 'referer' || header === 'x-devtools-emulate-network-conditions-client-id' || header === 'cookie')
|
||||
if (IGNORED_HEADERS.has(header))
|
||||
continue;
|
||||
hash.headers[header] = headerValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user