Don't write chunked responses to HTTP/1.0 clients #1234
Comments
Bug fix and test cases. Merge! One semi-surprising datum is that the two HTTP/1.1 chunks emitted by the server arrive as a single TCP packet on the client. Is this the kernel being clever? Because I don't think it's node doing the buffering. Anyway. |
should respond with http/1.1 and but without chunked. terminate message with eof. |
To be clear - Node should always use HTTP/1.1 in its status line, no matter what the client says (as long as Node is HTTP/1.1 conformant, of course). However, it shouldn't chunk a response to a 1.0 client. |
Node's HTTP server is already implemented like that @mnot says. But Node's HTTP client supports only HTTP/1.1. Therefore node-http-proxy always sends HTTP/1.1 request to the actual server, doesn't it?
Node HTTP client should support for HTTP/1.0? |
No, it is not necessary.
|
While it's at it, node-http-client needs to delete all "hop-by-hop" headers, in both directions; see: |
@koichik - it also needs to modify the response that it's sending - remove the chunk frames and terminate the message with EOF (since it does not know the content-length) |
@ry - It is not necessary. Because |
@indexzero Can this be closed? |
By default, Node does not send chunked response to HTTP/1.0 client. So, I think that node-http-proxy should not set |
@koichik Ok. But is this fix available in 0.4.x? Or is it only available in 0.5.x? |
Since v0.1.21 (c5d8238) :-) |
Closed by http-party/node-http-proxy#125 |
This is a follow up to this bug on node-http-proxy. The behavior can be seen as follows:
The source of this bug seems to be squarely in the
ServerResponse
object. I don't know how much things have changed inv0.5.0
but the statusLine written to all outgoing requests is hard-coded to HTTP/1.1. There is probably more to it, but for starters it seems like theServerResponse
object should infer the version of the HTTP protocol to use from the associated ServerRequest.The text was updated successfully, but these errors were encountered: