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

fix: handle parameters in Content-Type header #2055

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andreea-Lupu
Copy link
Contributor

What type of PR is this?

Which issue does this PR fix:
#1710

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Signed-off-by: Andreea-Lupu <andreealupu1470@yahoo.com>
Copy link

codecov bot commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4fb1e75) 91.84% compared to head (8436c57) 91.84%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2055   +/-   ##
=======================================
  Coverage   91.84%   91.84%           
=======================================
  Files         164      164           
  Lines       27992    27997    +5     
=======================================
+ Hits        25709    25714    +5     
  Misses       1685     1685           
  Partials      598      598           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -663,7 +663,7 @@ func (rh *RouteHandler) UpdateManifest(response http.ResponseWriter, request *ht
return
}

mediaType := request.Header.Get("Content-Type")
mediaType := zcommon.GetContentType(request)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two places in pkg/api/routes.go?
666: mediaType := request.Header.Get("Content-Type")
1219: if contentType := request.Header.Get("Content-Type"); contentType != constants.BinaryMediaType {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure about L1219. In spec it is specified for /v2/{name}/manifests/{reference} [put] (L666) that the parameters on the Content-Type header should be ignore , but for /v2/{name}/blobs/uploads [post] (L1219) there is no info about that. Do you think I should make the change also for L1219?

@andaaron andaaron added this to the v2.1.0 milestone Nov 29, 2023
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

Successfully merging this pull request may close these issues.

[Bug]: Handle parameters in "Content-Type=<oci-media-types>; charset=utf-8"
3 participants