进行http.request时发生HPE_HEADER_OVERFLOW异常 [英] HPE_HEADER_OVERFLOW exception when make http.request
本文介绍了进行http.request时发生HPE_HEADER_OVERFLOW异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试从REST服务获取数据时,遇到HPE_HEADER_OVERFLOW错误,如下所示:
When I tried to get data from REST service, i meet the HPE_HEADER_OVERFLOW error as follow:
var options = {
host: "something.com",
port: 80,
path: "/somepath...",
method: 'POST'
};
var request = http.request(options, function(res) {
res.setEncoding('utf8');
res.on('data', function(chunk) {
// Do something
});
res.on('end', function() {
// Do something
});
request.on('error', function(e) {
// Do something
});
});
request.end();
选项中path参数的长度为413.
The length of path parameter in the options is 413.
有人遇到这个问题吗?是服务端问题还是节点端问题?
Does anyone meet this issue? Is this service-side issue or node-side issue?
请给我一些想法,非常感谢.
Please give some idea about it, thanks a lot.
推荐答案
node app.js --max-http-header-size=80000
它们使标头大小可配置.检查以下链接.
They made the header size configurable. Check the following links.
https://nodejs.org/api/cli.html#cli_max_http_header_size_size
https://github.com/nodejs/node/issues/24692
这篇关于进行http.request时发生HPE_HEADER_OVERFLOW异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文