Repository navigation
fix(webkit): refresh intercepted request headers after response - #44184
microsoft-playwright-automation[bot] wants to merge 3 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
🟢 All four failures are pre-existingI'm the Playwright bot. I checked the MCP failures at Failure evidenceCovers MCP run 44152654090. The request-header changes do not explain these failures: the same tests fail with the same errors without this PR. Pre-existing flake / infra
Checked the failures on Linux by the Playwright bot - agent run |
| const cookie = (await response.request().allHeaders())['cookie']; | ||
| expect(cookie).toBe('myCookie=myValue; myOtherCookie=myOtherValue'); | ||
|
|
||
| await page.route('**/never-match', route => route.continue()); |
There was a problem hiding this comment.
This is ridiculous, it should not have merged it into this test. I'm udpating the AGENTS.md
There was a problem hiding this comment.
Restored the original cookie test and moved the unrelated-route case into a separate, issue-tagged fetch test. It fails on WebKit without the fix and passes on all three browsers.
| return await this._actualHeadersPromise; | ||
| } | ||
|
|
||
| _setResponse(response: Response) { |
There was a problem hiding this comment.
Since this is a webkit-specific error, I expect webkit-specific fix.
There was a problem hiding this comment.
Removed the client cache reset; only WebKit's response handler now requests replacement of provisional headers, while the shared setter keeps its original default behavior. Header reads during paused interception retain their existing behavior.
This comment has been minimized.
This comment has been minimized.
b842764 to
b0194ac
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| // "null" means no raw headers available - we'll use provisional headers as raw headers. | ||
| setRawRequestHeaders(headers: HeadersArray | null) { | ||
| setRawRequestHeaders(headers: HeadersArray | null, force = false) { | ||
| if (force && this._rawRequestHeadersPromise.isDone()) |
There was a problem hiding this comment.
We cannot afford allHeaders() changing the value. Also, client caches the value anyway, so it depends on the timing of the first client call. Let's explore taking cookies from the cookie jar in this "intercepted request" case.
There was a problem hiding this comment.
WebKit now fills missing Cookie headers from the URL-filtered cookie jar before publishing the intercepted request. Removed header replacement; the test checks early reads and unchanged headers after a Set-Cookie response. The docs explain the remaining cookie-policy and credentials-mode limits.
Revised on macOS by the Playwright bot - agent run
This comment has been minimized.
This comment has been minimized.
|
Hi, I'm the Playwright bot. I replaced the header refresh with a WebKit-only cookie lookup before intercepted requests are exposed. The reported headers now stay unchanged after the response. I also documented that intercepted headers may differ from those sent, including WebKit's cookie-policy and credentials-mode limits. On macOS, the regression fails without the fix and passes on Chromium, Firefox and WebKit. The seven network and routing test files passed: 567 passed, 21 skipped. The final cookie checks passed on all three browsers; build and full lint passed. Linux and Windows were not tested. Revised on macOS by the Playwright bot - agent run |
b0194ac to
3b3333d
Compare
Test results for "tests 1"23684 passed, 708 skipped Merge workflow run. |
Test results for "MCP"5257 passed, 644 skipped Merge workflow run. |
WebKit resolves intercepted request headers with provisional values before sending the request. Let actual headers replace those values when they arrive, and clear the client's early header cache when the response arrives.
Extend the existing cookie-header test with an unrelated route and an early header read.
Fixes #44170
Triaged on macOS by the Playwright bot - agent run