Servers - General

HPE_INVALID_HEADER_TOKEN : Nodejs request

 
Joseph735
Occasional Visitor

HPE_INVALID_HEADER_TOKEN : Nodejs request

I receive HPE_INVALID_HEADER_TOKEN on a certain page using request module. From what I've found on Google, this is caused by an incorrect / malformed server response, however the latter is not under my control. Can I configure request to ignore invalid headers or just give me the whole raw response for processing?

 

6 REPLIES 6
Parvez_AL
Community Manager

Re: HPE_INVALID_HEADER_TOKEN : Nodejs request

Hi Joseph,

Can you please provide more details about which HPE product this is related to so that we can direct your question to the correct discussion board.

 


Thanks,
Parvez_AL
I work for HPE
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
CM_Cert_Logo_Color.png
Al22ma
New Member

Re: HPE_INVALID_HEADER_TOKEN : Nodejs request

I receive HPE_INVALID_HEADER_TOKEN on a certain page using request module.

Spencer235
Occasional Visitor

Re: HPE_INVALID_HEADER_TOKEN : Nodejs request

Thank you for information

Aimee21
New Member

Re: HPE_INVALID_HEADER_TOKEN : Nodejs request

Node v12 has a new parser that is more strict with header validation, which can cause the same errors, especially with sites using

rnestina
New Member

Re: HPE_INVALID_HEADER_TOKEN : Nodejs request

It does look like the new parser of Node 12 is more strict. However, since the error comes from a remote server that is entirely beyond our control, it seems that a more strict parser is a disadvantage, rather than an advantage.

Do you know whether the legacy option will ever be removed in the future? I worry that it will cause a lot of problems that can't be fixed from our end

Mayer7
Frequent Visitor

Re: HPE_INVALID_HEADER_TOKEN : Nodejs request

That response is malformed. According to the http spec, spaces are not permitted in header field names. So this is a case of the old http parser being less strict than the new http parser that's on by default in node v12.