Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs(route): header override propagation (#32971)

Yury Semikhatsky4fe33db392b0
diff --git a/docs/src/api/class-route.md b/docs/src/api/class-route.md
index 106fbf55e0..c4e5fcb2e4 100644
--- a/docs/src/api/class-route.md
+++ b/docs/src/api/class-route.md
@@ -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.
diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts
index fe182dac4e..abf92c0141 100644
--- a/packages/playwright-core/types/types.d.ts
+++ b/packages/playwright-core/types/types.d.ts
@@ -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