chore(bidi): remove request body headers from overrides for redirected requests#39106
Conversation
Test results for "tests 1"4 failed 2 flaky34271 passed, 662 skipped Merge workflow run. |
Test results for "MCP"40 failed 4531 passed, 135 skipped Merge workflow run. |
| import type * as types from '../types'; | ||
| import type { BidiSession } from './bidiConnection'; | ||
|
|
||
| const REQUEST_BODY_HEADERS = new Set(['content-encoding', 'content-language', 'content-location', 'content-type']); |
There was a problem hiding this comment.
Is 'content-length' intentionally omitted?
Note that have similar logic for out fetch API here.
Fixes "continue should drop content-length on redirects" in
page/page-request-continue.spec.ts.Note that according to the spec (step 12) browsers look at the redirect response status and the original request's method to decide whether to remove the request's body (and change its method) but we don't have sync access to the original request's reponse, so we always remove the request body headers when the redirect turned a POST into a GET request. Since GET requests should never have a body, this should be safe.