Support HTTP/1.1 Upgrade to raw TCP stream
I notice that my code fails after (fail if user tries writing bytes after request is sent #270) change.
Background: I use this API https://docs.docker.com/engine/api/v1.41/#operation/ContainerAttach that hijack the connection and allow to send back body after the request is sent. The connection stays active and the server expects and accepts more data.
Problem: After the change, HTTPHandler rejects further writes to body, thas is undesired in this scenario.
Hmm, the issue here is that AHC does not want to allow unclearly-framed stream data. Specifically, it doesn't support this notion of "connection hijacking".
The better model of support for this mode would be to tell AHC how to understand HTTP/1.1 Upgrade. This would still support this endpoint, but it would stop AHC from thinking it has any understanding of what you're trying to do.
Agreed, we should support HTTP/1.1 upgrade to support this properly. @krzyzanowskim unfortunately, with a connection pool we can't just allow you to send more bytes after the request is finished, that would have security implications because it could allow request smuggling if you were to use AHC to implement a (buggy) proxy implementation.
Should we retitle this issue as "Support HTTP/1.1 Upgrade to raw TCP stream"?