node_pcap icon indicating copy to clipboard operation
node_pcap copied to clipboard

HTTP messages delimited with Connection: close

Open mnot opened this issue 14 years ago • 4 comments

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.

mnot avatar Nov 25 '10 00:11 mnot

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.

mranney avatar Nov 27 '10 06:11 mranney

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

mnot avatar Nov 27 '10 23:11 mnot

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?

mranney avatar Dec 06 '10 00:12 mranney

I think there are a few different scenarios, potentially -

  1. Getting a Connection: close without any Transfer-Encoding or Content-Length
  2. Getting a Content-Length, but having the close happen before the full response is sent
  3. 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.

mnot avatar Dec 07 '10 05:12 mnot