fix: Add connection upgrade headers #21
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
/containers/{id}/attachand/exec/{id}/startAPIs were missing the connection upgrade headers. Without these headers, the connection doesn't get upgraded, which breaks communication withstdin. Basically, if the headers aren't set, writing tostdinjust won't work.The Docker Engine API docs make it seem like these headers are optional, but either they're actually required or Docker Desktop specifically needs them because of how its internal communication works.
In a follow-up PR, we need to take a look at the
/containers/{id}/logsAPI calls (and their tests). It looks like they're including the multiplexed header (incl. the chunked size), which should be removed.stdinfails while command expects input (/exec/{id}/start). #20Edit: Looks like we can't fix the
/containers/{id}/logsAPI call in a separate PR. A test is failing as expected because of the issue mentioned above.