-
Notifications
You must be signed in to change notification settings - Fork 542
conformance test: CORS #3739
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?
conformance test: CORS #3739
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
Hi @zhaohuabing. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zhaohuabing 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 |
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Hi @mikemorris @sunjayBhatia @youngnick Is there anything I can do to help the review? This is the first time creating a conformance test PR, so there is a good chance I may have missed something that's blocking the review. Please feel free to let me know if there's anything I can address. Thanks! cc @arkodg |
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Headers: map[string]string{ | ||
"Origin": "https://www.bar.com", | ||
"access-control-request-method": "GET", | ||
"access-control-request-headers": "x-header-1, x-header-2", |
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.
According to the specification (https://github.com/kubernetes-sigs/gateway-api/blob/main/apis/v1/httproute_types.go#L1386), headers (and also methods) are separated by ","
instead of ", "
.
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've tested this against Envoy Gateway, and the methods in the access-control-request-headers
header are separated by ", ". Also, the example in https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Methods contains whitespaces.
Access-Control-Allow-Methods: PUT, DELETE
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.
Maybe we are both right and the whitespace is optional: https://httpwg.org/specs/rfc9110.html#rfc.section.5.3 (from https://fetch.spec.whatwg.org/#http-new-header-syntax)
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.
Yeah, you're right. The test should accommodate both formats.
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.
@snorwin I added an option to ignore the whitespace in the header value.
@zhaohuabing I verified the new CORS tests against our implementation and identified a difference in how the Just a heads-up: depending on the outcome of #3648, the tests might need to be adapted or extended accordingly. |
Co-authored-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
Co-authored-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
e6c17a3
to
d0e2f9a
Compare
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing lgtm, however, since I’m not part of the approvers, I’m unable to formally approve it. |
Gentle ping @youngnick @sunjayBhatia @mikemorris — whenever you get a chance, would love your thoughts on this. |
/ok-to-test |
/test pull-gateway-api-verify |
Co-authored-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
What type of PR is this?
/kind test
/area conformance-test
What this PR does / why we need it:
This PR adds conformance tests for HTTPCORSFilter.
Which issue(s) this PR fixes:
Related #3649
Does this PR introduce a user-facing change?:
None