Fix archive PUTs missing Content-Type - #51
Open
phattbeats wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Thanks for opening this pull request! Be sure to follow the pull request template!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description:
Default
Content-Typetoapplication/x-tarfor Docker archive extraction PUT requests when the client omitted the header. Explicit client content types remain unchanged.Benefits of this PR and context:
Docker's
PUT /containers/{id}/archiveendpoint can return HTTP 200 while extracting nothing when the request has noContent-Type. That creates a silent-success failure mode for callers sending a valid tar body. Supplying the endpoint's documented media type at the proxy keeps header-less clients from receiving a false success.The rule is restricted to PUT requests whose decoded path exactly matches the versioned or unversioned container archive endpoint.
How Has This Been Tested?
Reproduced against Docker 24.0.9 through socket-proxy 3.4.2-r0-ls89:
Content-Type: HTTP 200, subsequent archive GET returned 404.Content-Type: application/x-tar: HTTP 200, subsequent archive GET returned 200.git diff --checkpasses.A local HAProxy syntax check could not be run in the submitting environment because it lacks a Docker CLI and the deployed proxy denies container creation.
Source / References: