Skip to content
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

docs(route): header override propagation #32971

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/api/class-route.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ await page.RouteAsync("**/*", async route =>

**Details**

Note that any overrides such as [`option: url`] or [`option: headers`] only apply to the request being routed. If this request results in a redirect, overrides will not be applied to the new redirected request. If you want to propagate a header through redirects, use the combination of [`method: Route.fetch`] and [`method: Route.fulfill`] instead.
The [`option: headers`] option applies to both the routed request and any redirects it initiates. However, [`option: url`], [`option: method`], and [`option: postData`] only apply to the original request and are not carried over to redirected requests.

[`method: Route.continue`] will immediately send the request to the network, other matching handlers won't be invoked. Use [`method: Route.fallback`] If you want next matching handler in the chain to be invoked.

Expand Down
12 changes: 6 additions & 6 deletions packages/playwright-core/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20609,12 +20609,12 @@ export interface Route {
*
* **Details**
*
* Note that any overrides such as [`url`](https://playwright.dev/docs/api/class-route#route-continue-option-url) or
* [`headers`](https://playwright.dev/docs/api/class-route#route-continue-option-headers) only apply to the request
* being routed. If this request results in a redirect, overrides will not be applied to the new redirected request.
* If you want to propagate a header through redirects, use the combination of
* [route.fetch([options])](https://playwright.dev/docs/api/class-route#route-fetch) and
* [route.fulfill([options])](https://playwright.dev/docs/api/class-route#route-fulfill) instead.
* The [`headers`](https://playwright.dev/docs/api/class-route#route-continue-option-headers) option applies to both
* the routed request and any redirects it initiates. However,
* [`url`](https://playwright.dev/docs/api/class-route#route-continue-option-url),
* [`method`](https://playwright.dev/docs/api/class-route#route-continue-option-method), and
* [`postData`](https://playwright.dev/docs/api/class-route#route-continue-option-post-data) only apply to the
* original request and are not carried over to redirected requests.
*
* [route.continue([options])](https://playwright.dev/docs/api/class-route#route-continue) will immediately send the
* request to the network, other matching handlers won't be invoked. Use
Expand Down
Loading