-
Notifications
You must be signed in to change notification settings - Fork 445
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
Add lefthand-side wildcard support to descriptor values #458
Add lefthand-side wildcard support to descriptor values #458
Conversation
Signed-off-by: Luki Boras <[email protected]>
57551b1
to
366e127
Compare
Signed-off-by: Luki Boras <[email protected]>
Signed-off-by: Luki Boras <[email protected]>
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Hello, any chance to get this merged? |
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
for _, wildcardValue := range prevDescriptor.wildcardValues { | ||
wildcardKey := entry.Key + "_" + wildcardValue | ||
if strings.HasSuffix(entry.Value, strings.TrimPrefix(wildcardValue, "*")) { | ||
nextDescriptor = descriptorsMap[wildcardKey] | ||
break | ||
} | ||
if strings.HasPrefix(entry.Value, strings.TrimSuffix(wildcardValue, "*")) { |
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.
Are there any performance implications here due to the string comparison?
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 didn't check that for two reasons:
- I don't know how to perform a meaningful benchmark with regards to this piece of code
- Current code is already doing a string comparison in the same way
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Current wildcard implementation doesn't allow to have a following configuration:
This is useful if one needs to rate limit based on dynamic subdomains, like:
foo.example.com
,bar.example.com
,<unknown_yet>.example.com