-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix cors match #977
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
Fix cors match #977
Conversation
|
Please add comments explaining the logic. Thanks! |
|
Also, please consider adding a few examples of supported URLs here: Line 143 in b6b8959
|
server/media/media.go
Outdated
|
|
||
| matched := true | ||
| for i, part := range allowedParts { | ||
| if part == "*" && (i == 0 || part == allowedParts[i-1]) { |
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 don't understand the && (i == 0 || part == allowedParts[i-1]). Is it to prevent patterns like abc.*.example.com? Please add a comment with an explanation.
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.
turns out that this part was actually unnecessary
|
Any update on this? |
|
Thanks! |
Allow matching cors with wildcards like this
https://*.*.example.com,https://*.example.com