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

Ignore intervention header when generating request hash #3798

Closed
kdzwinel opened this issue Jan 17, 2019 · 1 comment
Closed

Ignore intervention header when generating request hash #3798

kdzwinel opened this issue Jan 17, 2019 · 1 comment

Comments

@kdzwinel
Copy link

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.11.0 (bug is also present in ToT - f8615c8 )
  • Platform / OS version: macOS 10.14.x
  • URLs (if applicable):
  • Node.js version: 8.9.0

What steps will reproduce the problem?

https://gist.github.com/kdzwinel/d853006b0934c9ae3b5852eb964f292c

  • Running bad.js script against test_page.html will fail (timeout) while vanilla CDP version of the same script (good.js) will succeed.
  • This happens because redirected request never completes.
  • It never completes because of the request hash difference.
  • Hash difference is caused by intervention header injected by the browser (because disallow-doc-written-script-loads is enabled).

Hash A:

"{"url":"http://de.ioam.de/tx.io?mg=no&st=toi&cp=%2Ftest%2Froot&oc=%2Froot&sv=in&pt=CP&ps=lin&er=N22&rf=&r2=&ur=example.com%3A8080&xy=1440x900x24&lo=ES%2Fxxx&cb=0012&i2=0012a7493b1041c925c360c56&ep=1569196621&vr=412&id=xi82n4&i3=nocookie&n1=3&dntt=0&lt=1547045974863&ev=&cs=z9zs2b&mo=1&sr=71","method":"GET","headers":{"user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/72.0.3617.0 Safari/537.36"}}"

Hash B:

"{"url":"http://de.ioam.de/tx.io?mg=no&st=toi&cp=%2Ftest%2Froot&oc=%2Froot&sv=in&pt=CP&ps=lin&er=N22&rf=&r2=&ur=example.com%3A8080&xy=1440x900x24&lo=ES%2Fxxx&cb=0012&i2=0012a7493b1041c925c360c56&ep=1569196621&vr=412&id=xi82n4&i3=nocookie&n1=3&dntt=0&lt=1547045974863&ev=&cs=z9zs2b&mo=1&sr=71","method":"GET","headers":{"intervention":"https://www.chromestatus.com/feature/5718547946799104; level="warning"","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/72.0.3617.0 Safari/537.36"}}"

What is the expected result?
intervention header should be appended to the IGNORED_HEADERS and/or all interventions should be disabled in puppeteer by default.

What happens instead?
intervention header causes some intercepted requests to 'hang'.

@kdzwinel
Copy link
Author

Thank you @aslushnikov 🙌

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

No branches or pull requests

1 participant