Skip to content

Commit

Permalink
docs(example): simplified overwriting of requests (#3621)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Aug 25, 2020
1 parent c25dfba commit 72b3147
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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});
});
```
Expand Down

0 comments on commit 72b3147

Please sign in to comment.