-
Notifications
You must be signed in to change notification settings - Fork 480
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
clarify behavior of multiple query param matches for the same key #1225
Comments
|
@shaneutt thanks for the comments!
This is not my understanding -- the spec says "If multiple entries specify equivalent header names, only the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, “foo” and “Foo” are considered equivalent." (see |
You know now that you mention it, I think I've been historically confused about this bit. After doing some re-reading I think what we're suggesting is that when there are multiples you "must only consider the first entry with name X, and all others are ignored". As written that seems to mean that duplicates are allowed, but entirely pointless, but we still expect downstream to handle that in their implementation. It's making me wonder if we should put that burden on the API instead and simply add validation that disallows duplicates? |
Yeah, I think it makes sense to add logic to the webhook for this since as you say, duplicates are pointless, though as an implementor I'd still want clear guidance on what to do if duplicates do make it to my implementation. I'm fine with the "use the first, ignore the rest" guidance for now. It sounds like you are in agreement that whatever we do for header matches, probably makes sense to do for query param matches too? |
Yeah, I'm with you on that 👍 |
I agree that we should both have the webhook validation try to stop duplicate matches for either header or query params, and that we should have the behavior in case something makes it through that all but the first must be ignored. |
+1 on consensus here, added to v0.5.0 milestone, appreciate if anyone has time to pick this one up in next day or two. |
I should be able to knock this out. |
/assign @skriss |
The spec does not indicate what should be done if a route
rulematch has multiple query param matches for the same key.For header matches, guidance is given to use the first match for a given header name, and to ignore subsequent ones for the same name (see https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.HTTPHeaderMatch).
I'd suggest adding the same guidance for query params, with the exception that query param names be case-sensitive. If this makes sense, I'll open a PR to add this to the spec. (I should also be able to add a conformance test for query params that includes this soon).
The text was updated successfully, but these errors were encountered: