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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The solution is this library: https://www.npmjs.com/package/http-parser-js
So to fix your problem:
npm install http-parser-js
Add this code before require('request')
process.binding('http_parser').HTTPParser = require('http-parser-js').HTTPParser;