I'm hosting a node.js application in an Azure Web App. This works well, except the server always returns HTTP 400 if the request is too long (ie. a long URL or many headers.)
It seems that the error is returned by the Kestrel gateway without reaching my application, and this happens if the length of the request exceeds 2581 bytes in length. The same problem does not occur when running locally. This is a GET request, and it does not make a difference whether the URL is long, or there are long headers.
My application simply returns the current time:
// Module dependencies
let http = require('http');
http.createServer(function (request, response) {
console.log('request ', request.url);
response.write("Request served at " + new Date().toISOString());
response.end();
}).listen(80);
If I request GET /anything the response is as expected. However if I do GET /{any_very_long_path} (or include a header with a long value) it fails.
Why would Azure be limiting the request length like this? The same issue does not happen when hosting an ASP.NET application.
from node.js Azure Web App returns 400 on long urls
No comments:
Post a Comment