-
Notifications
You must be signed in to change notification settings - Fork 106
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Andreea-Lupu <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
@@ -663,7 +663,7 @@ func (rh *RouteHandler) UpdateManifest(response http.ResponseWriter, request *ht | |||
return | |||
} | |||
|
|||
mediaType := request.Header.Get("Content-Type") | |||
mediaType := zcommon.GetContentType(request) |
There was a problem hiding this comment.
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 {
There was a problem hiding this comment.
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?
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.