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();
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.
I think you'll find more stuff here and here
In a nutshell, Node.js has 80 KB limit for headers size which are big enough for most requests on the web (for example Apache has 8190 bytes limit).
If that service somehow has so huge headers you can recompile node with -DHTTP_MAX_HEADER_SIZE=xxxx
argument.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With