-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: support wildcard domains with regex [MONET-2345] #2155
Conversation
'^(?:' + | ||
'(?:' + | ||
'(?:\\*\\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,6}' + | ||
'|\\*\\.[a-zA-Z]{2,6}' + // Matches wildcard domains like *.com |
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.
It should allow wildcards like *.example.com
but not allow *.com
, *
or *.too.example.com
@BasKiers updated 🫡 |
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.
Long live ChatGPT for understanding Regex syntax better than any human could
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.
LGTM 🙂
Ticket
We already support wildcard in allow networks Cloudflare. This PR allows users using this feature while creating an app with functions that has
allowNetworks
attribute.We update the regex that we use to validate networks.