You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is regarding the wildcard hostname support that was added with #32. It appears that as a consequence of sorting the servers by their hostname the wildcard will always sort before specific - * comes before alphanumeric character when sorting strings. As a result, it is not possible to have a specific rule beat out a wildcard rule.
Ideally we should be able to do the same thing that we can do with DNS - define *.example.com to go to one location, but allow api.example.com to be overridden and go to a different location.
I'm not sure the best way to do this - a quick and easy way to do this would be to sort in reverse so that * would be used last, but that would affect everyone even if they don't have any wildcard rules. Another option would be to find or implement a sort that sorts alphanumeric characters ahead of other characters. One other option that should work but less is than ideal (but is potentially faster than implementing a new sort) is to simply check if a hostname has a * in it, and if so sort it after the other hostname unless the other hostname also has a * in it.
Also, I'm not sure how this would affect regex hostnames. My guess is that those should probably also go after non-regex, non-wildcard hostnames, so ideally whatever solution we use would do that.
The text was updated successfully, but these errors were encountered:
Oh, I forgot to mention that I'm happy to do a pull request with whatever solution we decide would be best, but I wanted to have a discussion about what solution would be best first.
This is regarding the wildcard hostname support that was added with #32. It appears that as a consequence of sorting the servers by their hostname the wildcard will always sort before specific -
*
comes before alphanumeric character when sorting strings. As a result, it is not possible to have a specific rule beat out a wildcard rule.Ideally we should be able to do the same thing that we can do with DNS - define
*.example.com
to go to one location, but allowapi.example.com
to be overridden and go to a different location.I'm not sure the best way to do this - a quick and easy way to do this would be to sort in reverse so that
*
would be used last, but that would affect everyone even if they don't have any wildcard rules. Another option would be to find or implement a sort that sorts alphanumeric characters ahead of other characters. One other option that should work but less is than ideal (but is potentially faster than implementing a new sort) is to simply check if a hostname has a*
in it, and if so sort it after the other hostname unless the other hostname also has a*
in it.Also, I'm not sure how this would affect regex hostnames. My guess is that those should probably also go after non-regex, non-wildcard hostnames, so ideally whatever solution we use would do that.
The text was updated successfully, but these errors were encountered: