-
Notifications
You must be signed in to change notification settings - Fork 133
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
Prefix wildcard matching is required #18
Comments
I once encountered this problem when deciding the most appropriate matching paths and directories to serve for a cloud service during cache misses based off their prefix. I recall the algorithm that I used, it seems simple enough to find the most common prefix i.e.:
With some runnable code at https://gist.github.com/odeke-em/4101fc01adaea3bfead1241e561fcc61, it can further be optimized but that serves the purpose I believe. |
Fixes GoogleCloudPlatform#18 If any pathConfig is the shortest prefix of a query, find and return it. For example: * PathConfigs: {"/example/helloworld", "/example", "/", "/x"} Query|Result ---|--- "/example/helloworld/foo"|"/example/helloworld" "/foo"|"/" "/y"|"/" "foo"|"" "/y/x"|"" "/x/y"|"/x"
Fixes GoogleCloudPlatform#18 If any pathConfig is the shortest prefix of a query, find and return it. For example: * PathConfigs: {"/example/helloworld", "/example", "/", "/x"} Query|Result ---|--- "/example/helloworld/foo"|"/example/helloworld" "/foo"|"/" "/y"|"/" "foo"|"" "/y/x"|"/" "/x/y"|"/x"
Currently, govanityurls looks for an exact prefix match for the paths provided in the configuration file.
If user asks for
my.org/x
, govanityurls return a 404 instead of matching it with the second rule.What's expected is that we should match
/x
with the/
rule.The text was updated successfully, but these errors were encountered: