Servers - General
1830231 Members
1596 Online
109999 Solutions
New Discussion

Nodejs request: HPE_INVALID_HEADER_TOKEN

 
Gregory89
Occasional Visitor

Nodejs request: HPE_INVALID_HEADER_TOKEN

I get HPE_INVALID_HEADER_TOKEN on a specific page utilizing demand module. From what I've found on Google, this is brought about by a wrong/deformed server reaction, but the last option isn't influenced quite a bit by. Would i be able to design demand to overlook invalid headers or simply give me the entire crude reaction for handling?

 

CredibleBH Login

2 REPLIES 2
Suman_1978
HPE Pro

Re: Nodejs request: HPE_INVALID_HEADER_TOKEN

Hi,

The error HPE_INVALID_HEADER_TOKEN, as far as I know, its not related to HPE domain or company.

https://github.com/node-red/node-red/issues/974
http://www.yeolar.com/media/doc/coral/html/http__parser_8h.html

Thanks



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
creditexpress
New Member

Re: Nodejs request: HPE_INVALID_HEADER_TOKEN

Node v12 has a new parser that is more strict with header validation, which can cause the same errors, especially with sites using Imperva/Incapsula that include an invalid header in HTTP 1.1 responses.

A temporary solution is to use the --http-parser=legacy option in node's command line, or in the NODE_OPTIONS environment variable.

Since v12.15.0 and v10.19.0 you can do this:

http.request(url, { insecureHTTPParser: true })

Additional information can be found here: https://github.com/nodejs/node/issues/27711#issuecomment-584621376

Edit: --http-parser=legacy is no longer supported in recent versions (including minor versions of v12). A solution for newer node versions is to use --insecure-http-parser instead. Crediblebh