-
Notifications
You must be signed in to change notification settings - Fork 186
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
fixe(domain): wildcard parse bug #106
Conversation
I just noticed that there is a PR open for this, however it is from 2019...so I will leave this open as a reminder |
Note that Web origins do not contain a path. But I agree with you that a trailing wildcard is a terrible footgun; for instance, |
Hey, I just discovered this bug as well. Will this be merged or what's the status? |
I will take it. |
I just hit this bug, why isn't it merged yet? |
- Import the `reflect` package in `cors_test.go` - Add new test cases for parsing wildcard rules in CORS configuration - Implement tests to check for panic on multiple wildcards and validate expected results for various wildcard scenarios ref: #106 Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
It is interesting my five years aged PR #57 with the exactly same fix was closed without any endorsements.. lol |
I am sorry @maxshine, my PR was not meant to take your contribution away. I only realised after I'd written the PR that you wrote one with the exact same fix |
@Hvitgar Believe me I understand it is not about your contribution coincides with mine which was ready there for long time. I just hope this repo owner / maintainers would be able to do their job in a smart way. 😂 |
@maxshine, I apologize for not noticing that a similar PR had already been submitted when I was reviewing this PR. This was an oversight on my part, and I will be more careful in the future. |
@maxshine I updated the release note v1.6.0 release note that put the both of @Hvitgar and @maxshine in the list. |
I think there is a bug in the parseWildcardRules function - if the wildcard is at the end of the origin string, the character right before the wildcard is cut off, leading to potentially unwanted matches, for instance
https://example.com/*
would also validate anything onhttps://example.community/*
.For verification, just execute the code below:
which results in