Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support HTTP/1.1 Upgrade to raw TCP stream #353

Open
krzyzanowskim opened this issue Apr 7, 2021 · 2 comments
Open

Support HTTP/1.1 Upgrade to raw TCP stream #353

krzyzanowskim opened this issue Apr 7, 2021 · 2 comments

Comments

@krzyzanowskim
Copy link
Contributor

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.

@Lukasa
Copy link
Collaborator

Lukasa commented Apr 8, 2021

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.

@weissi
Copy link
Contributor

weissi commented Apr 8, 2021

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"?

@krzyzanowskim krzyzanowskim changed the title writing bytes after request is sent Support HTTP/1.1 Upgrade to raw TCP stream Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants