Kong: about the 'uris' use uppercase and lowercase letters

Created on 28 May 2018  路  2Comments  路  Source: Kong/kong

NOTE: GitHub issues are reserved for bug reports only.

Please read the CONTRIBUTING.md guidelines to learn on which channels you can
seek for help and ask general questions:

https://github.com/Kong/kong/blob/master/CONTRIBUTING.md#where-to-seek-for-help

Summary

if the api setting the 'urls' use uppercase and lowercase letters , the kong proxy not find the api router
{"message":"no route and no API found with those values"}

Steps To Reproduce

  1. api setting
    uris=/demo/api/getdata
  2. in the browse use the
    http://xxx:8000/DEMO/api/getdata
    or http://xxx:8000/DEMO/Api/getdata
    reponse: {"message":"no route and no API found with those values"}
  3. but if use
    http://xxx:8000/demo/api/getdata
    can find the router
  4. uppercase and lowercase letters ?
    why? how to set the uri ignore the uppercase and lowercase ?

Additional Details & Logs

  • Kong version ($ kong version)
  • Kong debug-level startup logs ($ kong start --vv)
  • Kong error logs (<KONG_PREFIX>/logs/error.log)
  • Kong configuration (registered APIs/Plugins & configuration file)
  • Operating System

Most helpful comment

You can enable case-insensitivity by using regexes in paths.

Given the following path:

/(?i)demo/api/getdata

The proxy would match the rule to these requests:

/demo/api/getdata
/DEMO/Api/getdata

You can view an example of this at work here.

I have raised a documentation concern and potentially a flag for ease-of-use regarding this here, as even with an example it can be confusing to others how this would affect sub-paths as well, since those too would be case-insensitive.

All 2 comments

You can enable case-insensitivity by using regexes in paths.

Given the following path:

/(?i)demo/api/getdata

The proxy would match the rule to these requests:

/demo/api/getdata
/DEMO/Api/getdata

You can view an example of this at work here.

I have raised a documentation concern and potentially a flag for ease-of-use regarding this here, as even with an example it can be confusing to others how this would affect sub-paths as well, since those too would be case-insensitive.

thank you!

Was this page helpful?
0 / 5 - 0 ratings