Open
Description
What happened:
Gateway API has validations that only account for 301 and 302 HTTP Redirects.
gateway-api/apis/v1/httproute_types.go
Line 1069 in 1edf7e9
What you expected to happen:
RFC 2616 defines several other redirects, including: 303, 304, 305, and 307.
Anything else we need to know?:
Ask would be to align enum validations to RFC2616 section 10.3
Thank you!
Activity
youngnick commentedon Jan 30, 2024
It seems very reasonable to me to ensure that all the valid redirect codes can be used in this enum.
But it does raise the question of whether we should be testing the behavior for each redirect code? Currently we are only testing
301
in the conformance tests.shaneutt commentedon Jan 30, 2024
+1
Yes, it does seem like some simple conformance tests around this would be ideal to help reduce implementations being caught off-guard by requirements.
WojciechLuczkow-Flyr commentedon Mar 5, 2024
Hello, There is actually issue linked with that:
In postman, by default, 301 and 302 redirect change request method to
GET
(unless configured to not do it).According to Mozilla docs:
In order to ensure guarantees that the method and the body will not be changed when the redirected request is made:
307 or 308 should be used for redirect.
danehans commentedon Mar 5, 2024
+1 on having conformance test coverage for the additional status codes.
k8s-triage-robot commentedon Jun 3, 2024
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied,lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
JackStromberg commentedon Jun 3, 2024
/remove-lifecycle stale
To loop back around, is it acceptable to follow RFC; outstanding action being additional conformance test coverage for addition of those status codes?
robscott commentedon Jun 3, 2024
Thanks for the follow up on this. Since this is relatively small in scope, I don't think we'd really need a GEP for this, but I'd love to see it get into v1.2.
robscott commentedon Jun 3, 2024
Given all the supportive comments above, I think we can mark this as accepted.
/triage accepted
robscott commentedon Jun 3, 2024
@JackStromberg do you have time to work on this?
divarvel commentedon Oct 14, 2024
RFC2616 is quite outdated, so the status list from the original post is incomplete.
RFC9110 adds the 308 response code as well https://httpwg.org/specs/rfc9110.html#status.308
danehans commentedon Jun 6, 2025
@robscott if this is not considered a bug, can you remove the applicable label (xref)?
robscott commentedon Jun 6, 2025
/remove-kind bug
/kind feature
JackStromberg commentedon Jun 6, 2025
fyi -- looks like this is being worked on. Thank you @davidwin93!
Cross referencing: #3823