-
Notifications
You must be signed in to change notification settings - Fork 826
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 parsing the media type in GameServerAllocation #1749
Fix parsing the media type in GameServerAllocation #1749
Conversation
Build Succeeded 👏 Build Id: 45774ee4-5914-41d3-9c79-d5c00056d229 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
info, ok := k8sruntime.SerializerInfoForMediaType(mediaTypes, r.Header.Get("Content-Type")) | ||
mt, _, err := mime.ParseMediaType(r.Header.Get("Content-Type")) | ||
if err != nil { | ||
return gsa, err |
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.
can we errors.Wrapf(....) this error message before passing it back out, so we can capture context?
Outside of that, this looks good to go.
Add a call to filter out optional parameters send in an HTTP header.
a3bd965
to
ac94465
Compare
Tested latest version:
|
Build Succeeded 👏 Build Id: a61ac52f-5d59-4072-9e53-0f0ddf02e5d9 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
info, ok := k8sruntime.SerializerInfoForMediaType(mediaTypes, r.Header.Get("Content-Type")) | ||
mt, _, err := mime.ParseMediaType(r.Header.Get("Content-Type")) | ||
if err != nil { | ||
return gsa, errors.Wrap(err, "error parsing mediatype from a request header") |
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.
Fantastic!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aLekSer, markmandel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add a call to filter out optional parameters send in an HTTP header.
Add a call to filter out optional parameters send in an HTTP header.
What type of PR is this?
/kind bug
What this PR does / Why we need it:
There are parameters like
charset
which would coexist inContent-Type
header. That's leadruntime.SerializerInfoForMediaType
to fail, because unexpected parameter was provided.Which issue(s) this PR fixes:
Closes #1748 .
Special notes for your reviewer:
Thanks @markmandel for providing the solution in the issue comment
Steps to reproduce:
Proof of the fix: