Page MenuHomePhabricator

Proton fails when setting Host header in recent Puppeteer versions
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

Actual Results:
Result from the request is:

{
    name: "HTTPError",
    message: "500",
    status: 500,
    detail: "Internal Server Error"
}

Servers log:

{"name":"proton","hostname":"82a50cad1e5b","pid":329,"level":50,"msg":"Unexpected error: Error: net::ERR_INVALID_ARGUMENT at https://en.wikipedia.org/w/index.php?title=Barack_Obama","trace":"Error: net::ERR_INVALID_ARGUMENT at https://en.wikipedia.org/w/index.php?title=Barack_Obama\n    at navigate (/opt/service/node_modules/puppeteer-core/lib/FrameManager.js:120:37)\n    at process._tickCallback (internal/process/next_tick.js:68:7)\n  -- ASYNC --\n    at Frame.<anonymous> (/opt/service/node_modules/puppeteer-core/lib/helper.js:111:15)\n    at Page.goto (/opt/service/node_modules/puppeteer-core/lib/Page.js:674:49)\n    at Page.<anonymous> (/opt/service/node_modules/puppeteer-core/lib/helper.js:112:23)\n    at puppeteer.launch.then.then.then.then.then.then (/opt/service/lib/renderer.js:181:30)\n    at process._tickCallback (internal/process/next_tick.js:68:7)","levelPath":"error/request","time":"2020-01-07T15:59:51.378Z","v":0}

Expected Results:

  • Request returns PDF

Notes:

  • Removing the line that set extra http headers, fix the issue.
    • Chromium is not accepting host header sent from puppeteer

Event Timeline

MSantos renamed this task from Proton fails when setting Extra HTTP Headers to Proton fails when setting Extra HTTP Headers in debian buster.Jan 8 2020, 4:44 PM
Mholloway claimed this task.
Mholloway subscribed.

This is fixed simply by omitting the Host header, the setting of which is forbidden by Chromium. See discussion on the patch.

Mholloway renamed this task from Proton fails when setting Extra HTTP Headers in debian buster to Proton fails when setting Host header in recent Puppetteer versions.Feb 5 2020, 11:06 PM
Mholloway renamed this task from Proton fails when setting Host header in recent Puppetteer versions to Proton fails when setting Host header in recent Puppeteer versions.