Skip to content

Conversation

@Cold-Coast
Copy link

Allow matching cors with wildcards like this https://*.*.example.com, https://*.example.com

@or-else or-else changed the base branch from master to devel October 26, 2025 07:36
@or-else
Copy link
Contributor

or-else commented Oct 26, 2025

Please add comments explaining the logic. Thanks!

@or-else
Copy link
Contributor

or-else commented Oct 26, 2025

Also, please consider adding a few examples of supported URLs here:

// Origin URLs allowed to download files, e.g. ["https://www.example.com", "http://example.com"].

@Cold-Coast Cold-Coast closed this Oct 28, 2025
@Cold-Coast Cold-Coast reopened this Oct 28, 2025

matched := true
for i, part := range allowedParts {
if part == "*" && (i == 0 || part == allowedParts[i-1]) {
Copy link
Contributor

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.

Copy link
Author

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

@or-else
Copy link
Contributor

or-else commented Nov 3, 2025

Any update on this?

Андрей Верчук added 2 commits November 4, 2025 14:03
@or-else or-else merged commit 11cbbd1 into tinode:devel Nov 4, 2025
@or-else
Copy link
Contributor

or-else commented Nov 4, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants