fix: crash when doing redirect navigation with webRequest listener (#21838)

* fix: pass navigation_ui_data to proxying factory

* fix: clone response instead of move in redirect
This commit is contained in:
Cheng Zhao 2020-01-22 10:31:10 +09:00 committed by GitHub
parent 36fac7bfec
commit fbc2f8344f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 6 deletions

View file

@ -121,6 +121,14 @@ describe('webRequest module', () => {
const { data } = await ajax(defaultURL)
expect(data).to.equal('/redirect')
})
it('does not crash for redirects', async () => {
ses.webRequest.onBeforeRequest((details, callback) => {
callback({ cancel: false })
})
await ajax(defaultURL + 'serverRedirect')
await ajax(defaultURL + 'serverRedirect')
})
})
describe('webRequest.onBeforeSendHeaders', () => {