-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
eat CRLF between requests even on connection:close #47
Comments
Fixed if you can live with the fact that message_complete_on_eof == FALSE. The on_message_complete event fires when there is still data in the input buffer so currently_parsing_eof is FALSE at that point. |
I love how GitHub gets confused when you prune/delete branches. The commits that matter are cc58dd715b47042abd6d86783c9e4b30e816ff9b and 41ac20859fe0c7bf1b3e391edf4c16381297bc49. |
@bnoordhuis looks like you have made some changes to code but you have not opened a pull request |
Still a problem in node 0.6.15. Here's some code that will show you what I mean. Behavior is different depending on whether or not you include the Connection: close header. GET messages also act differently than POST messages. If you make test cases, be sure to cover all four scenarios. var port = 8001;
var server = require('http').createServer(function (req, res) {
setTimeout(function () {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end("Hello World\n");
}, 500);
}).listen(port);
console.log('Server created on port ' + port);
var client = require('net').connect(port, 'localhost', function () {
request = "POST /post HTTP/1.1\r\n" +
"Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n" +
"Content-Length: 6\r\n" +
// This line is crucial - behavior is different if you comment it out
"Connection: close\r\n" +
"Host: localhost\r\n" +
"\r\n" +
"Sample\r\n" + // Valid all through here
"\r\n"; // This is the invalid part
console.log('Writing request');
client.write(request);
});
client.on('data', function (data) {
console.log('Data: ' + data.toString());
});
client.on('end', function () {
console.log('End');
server.close();
}); I only get this output:
More detailed information is available here: http-party/node-http-proxy#41 Please reopen this issue. |
@fidian: The fix for this issue was landed in c3153bd but the http-parser in node v0.6.15 is only at commit b47c44d. I've back-ported the fix in nodejs/node-v0.x-archive@d03b80b. If you want to submit regression tests, please do so as a pull request against joyent/node. |
Sorry, I usually would check the commit hash instead of just getting the latest version, but I thought that this would have made it into node by now since the issue was closed two months ago. Sorry for the confusion. |
see nodejs/node-v0.x-archive#1165
we need a failing test
The text was updated successfully, but these errors were encountered: