mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
docs(example): simplified overwriting of requests (#3621)
This commit is contained in:
parent
c25dfba878
commit
72b3147d7c
@ -3900,10 +3900,11 @@ Continues route's request with optional overrides.
|
||||
```js
|
||||
await page.route('**/*', (route, request) => {
|
||||
// Override headers
|
||||
const headers = Object.assign({}, request.headers(), {
|
||||
const headers = {
|
||||
...request.headers(),
|
||||
foo: 'bar', // set "foo" header
|
||||
origin: undefined, // remove "origin" header
|
||||
});
|
||||
};
|
||||
route.continue({headers});
|
||||
});
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user