node_pcap
node_pcap copied to clipboard
HTTP messages delimited with Connection: close
When the response is delimited by the end of connection (i.e., they contain Connection: close, no Content-Length, no transfer-coding), a "http response complete" event needs to be generated.
Indeed it does. Thanks for letting me know.
Also, thanks for writing htracr. It's the tool I've been meaning to write for months now. It is fantastic.
Thanks for writing node_pcap -- it's amazingly useful. I looked at using Python, but node + node_pcap made it SO easy -- and I think others are coming to the same conclusion, e.g., https://twitter.com/#!/onecreativenerd/status/8629575789576192
I'd like to fix this. What's a good way to test it? Is there a server you know of that returns responses like this?
I think there are a few different scenarios, potentially -
- Getting a Connection: close without any Transfer-Encoding or Content-Length
- Getting a Content-Length, but having the close happen before the full response is sent
- Same as above, but with Transfer-Encoding instead of Content-Length
I think #1 should clearly generate the event; it's debatable whether #2 and #3 should (since the response isn't really complete, in a HTTP semantic sense, although it is from a pure messaging standpoint). Perhaps the event could pass in an indication of whether the response was really complete, or an error was encountered.
Testing #1 should be easy, I'd base it on one of the simple HTTP tests in node that uses a socket. I can dig something up if you like.