-
Notifications
You must be signed in to change notification settings - Fork 41.3k
Don't return proxied redirects to the client #92941
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
Conversation
@tallclair: The label(s) In response to this:
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. |
/retest |
@@ -453,7 +453,7 @@ redirectLoop: | |||
|
|||
// Only follow redirects to the same host. Otherwise, propagate the redirect response back. | |||
if requireSameHostRedirects && location.Hostname() != originalLocation.Hostname() { | |||
break redirectLoop | |||
return nil, nil, fmt.Errorf("hostname mismatch: expected %s, found %s", originalLocation.Hostname(), location.Hostname()) |
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.
This change doesn't immediately seem related to the release note, but seems ok.
Based on my read, error responses (greater than 400) are still allowed. I like this, it does what I need, but I want to make sure it is intentional on your part. /lgtm holding in case you want to do something different with errors. if you're ok passing them back as failures (I like that), feel free to release the hold. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, tallclair 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 |
@deads2k yep, that's intentional, for the same reasons you highlighted. Thanks! /hold cancel |
/retest |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
…941-upstream-release-1.16 Automated cherry pick of #92941: Don't return proxied redirects to the client
…941-upstream-release-1.17 Automated cherry pick of #92941: Don't return proxied redirects to the client
…941-upstream-release-1.18 Automated cherry pick of #92941: Don't return proxied redirects to the client
What type of PR is this?
/kind bug
What this PR does / why we need it:
Treat all non-101 (switching protocol) responses to upgrade requests as errors. If the server responds with a 200 but the client is expecting an upgrade, the behavior can be unpredictable and lead to a stuck client.
Does this PR introduce a user-facing change?:
/sig api-machinery
/milestone v1.19
/priority important-soon
/assign @liggitt @deads2k