-
Notifications
You must be signed in to change notification settings - Fork 553
Add 307 / 308 Redirect Status Code Support #3823
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
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: davidwin93 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @davidwin93! |
Hi @davidwin93. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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-sigs/prow repository. |
40c5a81
to
febeeba
Compare
Thanks @davidwin93, this will be a great improvement! /ok-to-test |
22fe26d
to
b5bf3dc
Compare
/cc |
Is there any suggestion that we would want to include in docs for this behavior for 301 and 302 responses? |
I'd like to see the user-facing docs updated as part of this PR -- thanks!! |
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.
echoing feedback from today's community meeting.
this may benefit from a SupportedFeature for gradual enablement, because if this gets in, if there is any implementation that does not support 307 and 308 they go out of conformance
@LiorLieberman in regards to SupportedFeature do I need to wait for this to get in first? |
Can we add this as Extended (optional)? |
no, these are two different things. when I said supported features I really meant a FeatureName - like https://github.com/kubernetes-sigs/gateway-api/blob/main/conformance/tests/httproute-response-header-modifier.go#L40 for example. And @candita, to your point, adding a featureName would mean it is initially extended, but as said during the meeting, we should communicate clearly we are only doing it for gradual enablement, with intentions to move it to core (and remove the featureName) once we communicated it enough |
@davidwin93 let me know if you need any assistance with this. See recent commit that did the same thing almost - e77c612 |
@LiorLieberman thanks for that example. I've added some new tests with a new feature. I assume I should revert my changes to the existing conformance tests? Ill also work on updating the docs shortly. |
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.
Thanks @davidwin93. Yes please revert the changes to existing conformance tests and their manifests.
features.SupportGateway, | ||
features.SupportHTTPRoute, | ||
features.SupportHTTPRouteSchemeRedirect, | ||
features.SupportHTTPRouteAdditionalRedirectStatusCodes, |
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.
are we anticipating any more codes in the future? haha.
should we specifically mention 307 and 308 in the feature name or no need?
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.
given the most recent discussion I think we might want to keep this generic.
Features: []features.FeatureName{ | ||
features.SupportMesh, | ||
features.SupportHTTPRoute, | ||
features.SupportHTTPRouteAdditionalRedirectStatusCodes, |
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.
features.SupportHTTPRouteAdditionalRedirectStatusCodes, | |
features.SupportMeshHTTPRouteAdditionalRedirectStatusCodes, |
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.
add add a feature for this in https://github.com/kubernetes-sigs/gateway-api/blob/main/pkg/features/mesh.go like you added in httproute.go
e01e9dc
to
53f835b
Compare
Not sure if this needs to take a step back in terms of process, but I was wondering if it would be possible to also add the 303 status code to cover the entire space of redirect codes. 303 is a more standardized alternative to 302 which is already supported. There is some inconsistency in whether clients preserve the original request body and method or switch to GET with 302, while 303 clearly defines this behavior. |
I'd be supportive of adding 303 as an acceptable analogue for 302 too @sybereal, adding support for that was a specific request from our Application Gateway for Containers team at Microsoft. /cc @JackStromberg |
[like] Jack Stromberg reacted to your message:
…________________________________
From: Mike Morris ***@***.***>
Sent: Thursday, June 26, 2025 4:25:09 PM
To: kubernetes-sigs/gateway-api ***@***.***>
Cc: Jack Stromberg ***@***.***>; Manual ***@***.***>
Subject: Re: [kubernetes-sigs/gateway-api] Add 307 / 308 Redirect Status Code Support (PR #3823)
[https://avatars.githubusercontent.com/u/1149913?s=20&v=4]mikemorris left a comment (kubernetes-sigs/gateway-api#3823)<#3823 (comment)>
I'd be supportive of adding 303 as an acceptable analogue for 302 too @sybereal<https://github.com/sybereal>, adding support for that was a specific request from our Application Gateway for Containers team at Microsoft.
—
Reply to this email directly, view it on GitHub<#3823 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADSTTY6SGIIJIVJXTQ6K32T3FQNGLAVCNFSM6AAAAAB6EJLAHOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMBZGA2TMNZUGU>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
53f835b
to
2085875
Compare
@davidwin93: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. |
What type of PR is this?
/kind bug
/area conformance-test
What this PR does / why we need it:
This PR allows users to select either a 307 or 308 status code along with the existing options of 301 and 302. This matches RFC 9110 and by letting users select 308 it will match the existing nginx ingress behaviour of using a 308 for HTTP -> HTTPS redirects.
Which issue(s) this PR fixes:
Fixes #2748
Does this PR introduce a user-facing change?:
This will allow users to select 307 or 308 as redirect status codes along with 301 and 302.