-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Apiserver allows requests with empty location path #52922
Conversation
Hi @roycaihw. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: roycaihw Assign the PR to them by writing Associated issue: 52065 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/assign @liggitt |
Can you add a test for the redirection case to make sure this doesn’t regress? |
@@ -70,7 +70,9 @@ func (r *ProxyREST) Connect(ctx genericapirequest.Context, id string, opts runti | |||
if err != nil { | |||
return nil, err | |||
} | |||
location.Path = path.Join("/", location.Path, proxyOpts.Path) | |||
if location.Path != "" || proxyOpts.Path != "" { |
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.
Actually, I’m not sure this is right… what gets populated in proxyOpts.Path for “.../nodes/foo/proxy” and “.../nodes/foo/proxy/“?
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.
Empty strings I suppose. The if condition only affects the case when both location.Path and proxyOpts.Path are empty.
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 think the right fix is to fix the way proxyOpts.Path is populated for proxy subresources to preserve any leading and trailing slashes. Opened #52933 to do that instead
Removing label |
fixed by #52933 |
What this PR does / why we need it:
Revert part of #52065 to allow requests with empty location path, which should still be considered valid HTTP requests. Currently empty location paths are rewritten into "/", which breaks the redirection hack and changes the behavior in the related issues below.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #52813, fixes #52729Special notes for your reviewer:
The related issues reported behavior change between 1.7.5 and 1.7.6. This PR might need to be cherry-picked into 1.7 as #52065 does.
Release note: