docs: cancel is optional in OnHeadersReceivedResponse (#16506)

This commit is contained in:
Milan Burda 2019-01-25 15:41:21 +01:00 committed by John Kleinschmidt
parent 74c29fb610
commit e2516dc808

View file

@ -32,7 +32,7 @@ const filter = {
session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback) => {
details.requestHeaders['User-Agent'] = 'MyAgent'
callback({ cancel: false, requestHeaders: details.requestHeaders })
callback({ requestHeaders: details.requestHeaders })
})
```
@ -130,7 +130,7 @@ response are visible by the time this listener is fired.
* `responseHeaders` Object
* `callback` Function
* `response` Object
* `cancel` Boolean
* `cancel` Boolean (optional)
* `responseHeaders` Object (optional) - When provided, the server is assumed
to have responded with these headers.
* `statusLine` String (optional) - Should be provided when overriding