Skip to content

Commit

Permalink
docs(route): header override propagation (#32971)
Browse files Browse the repository at this point in the history
Fix #32939
  • Loading branch information
yury-s authored Oct 7, 2024
1 parent 9a6f03e commit 4fe33db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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 @@ -20614,12 +20614,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

0 comments on commit 4fe33db

Please sign in to comment.