Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent double request interception on POST #664

Merged
merged 1 commit into from Aug 19, 2022

Conversation

JeppeKnockaert
Copy link
Contributor

When submitting a post request through Browsershot you get the following error:

Error: Request is already handled!
    at assert (browsershot/node_modules/puppeteer/lib/cjs/puppeteer/common/assert.js:28:15)
    at HTTPRequest.continue (browsershot/node_modules/puppeteer/lib/cjs/puppeteer/common/HTTPRequest.js:349:32)
    at browsershot/bin/browser.js:198:40
    at browsershot/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:275:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async HTTPRequest.finalizeInterceptions (browsershot/node_modules/puppeteer/lib/cjs/puppeteer/common/HTTPRequest.js:188:9)

This is caused by intercepting the request twice in the browser.js script.

I've added a test that performs a real post which fails on the existing code and works after the change.

@freekmurze freekmurze merged commit 7125719 into spatie:main Aug 19, 2022
@freekmurze
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants