You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/03/04 08:17:55 UTC

[GitHub] [apisix] Horus-K opened a new issue #6513: bug: Can't match both upper and lower case arguments

Horus-K opened a new issue #6513:
URL: https://github.com/apache/apisix/issues/6513


   ### Issue description
   
   I can't match case sensitive parameters in two routes, it seems that apisix will think the two routes are the same
   
   ### Environment
   
   - apisix version (cmd: `apisix version`): 1.11.0
   - OS (cmd: `uname -a`):  centos7
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): 3.5
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks --version`):
   
   
   ### Steps to reproduce
   
   Create two routes, only the parameter appid is different
   {
       "uris": [
         "/micro/app/read",
         "/micro/app/read/*"
       ],
       "name": "read2",
       "vars": [
         [
           "arg_corpid",
           "IN",
           [
             "wwef5a06cd2931632c"
           ]
         ],
         [
           "arg_appid",
           "==",
           "1411"
         ]
       ],
       "plugins": {
         "redirect": {
           "ret_code": 307,
           "uri": "https://xxxxxx"
         }
       },
       "status": 1
     }
   {
       "uris": [
         "/micro/app/read",
         "/micro/app/read/*"
       ],
       "name": "read1",
       "vars": [
         [
           "arg_corpid",
           "IN",
           [
             "wwef5a06cd2931632c"
           ]
         ],
         [
           "arg_appId",
           "==",
           "1411"
         ]
       ],
       "plugins": {
         "redirect": {
           "ret_code": 302,
           "uri": "https://xxxxxxxx"
         }
       },
       "status": 1
     }
   
   ### Actual result
   
   Only one route takes effect, or the route with higher priority takes effect
   
   ### Error log
   
   NO
   
   ### Expected result
   
   Both appid and appID routes can take effect


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Horus-K commented on issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
Horus-K commented on issue #6513:
URL: https://github.com/apache/apisix/issues/6513#issuecomment-1059965352


   @spacewander If the variable is case-sensitive, why does only one of the two routes take effect?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Horus-K commented on issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
Horus-K commented on issue #6513:
URL: https://github.com/apache/apisix/issues/6513#issuecomment-1060247077


   这个问题我已经验证, 是路由优先级问题
   
   **不生效场景**
   
   | 路由名称       | id                 | 优先级 |
   | -------------- | ------------------ | ------ |
   | 路由灰度1      | 1014               | 0      |
   | 路由默认主路由 | 1134               | 0      |
   | 路由灰度2      | 397370888246264402 | 0      |
   
   路由灰度2 不生效
   
   
   
   **解决方法**
   
   将灰度路由优先级提高后灰度规则全部生效,appid 与 appId都能匹配
   
   **想法**
   
   可能是 路由默认主路由 后还有100多个路由,匹配不到吧(生产环境路由较多,可能吧)
   灰度路由只有在线上才有,没有想到优先级问题
   @soulbird @spacewander 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Horus-K closed issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
Horus-K closed issue #6513:
URL: https://github.com/apache/apisix/issues/6513


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Horus-K commented on issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
Horus-K commented on issue #6513:
URL: https://github.com/apache/apisix/issues/6513#issuecomment-1059746922


   `{
       "uris":[
           "/micro/app/read",
           "/micro/app/read/"
       ],
       "name":"read1",
       "vars":[
           [
               "arg_corpid",
               "IN",
               [
                   "wwef5a06cd2931632c"
               ]
           ],
           [
               "arg_appId",
               "==",
               "1411"
           ]
       ],
       "plugins":{
           "redirect":{
               "ret_code":302,
               "uri":"https://xxxxxxxx/"
           }
       },
       "status":1
   }`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tokers commented on issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #6513:
URL: https://github.com/apache/apisix/issues/6513#issuecomment-1059887714


   The `var` uses Nginx variable system and the latter is case insensitive.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Horus-K removed a comment on issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
Horus-K removed a comment on issue #6513:
URL: https://github.com/apache/apisix/issues/6513#issuecomment-1059746841


   {
       "uris":[
           "/micro/app/read",
           "/micro/app/read/"
       ],
       "name":"read2",
       "vars":[
           [
               "arg_corpid",
               "IN",
               [
                   "wwef5a06cd2931632c"
               ]
           ],
           [
               "arg_appid",
               "==",
               "1411"
           ]
       ],
       "plugins":{
           "redirect":{
               "ret_code":307,
               "uri":"https://xxxxxx/"
           }
       },
       "status":1
   }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] moonming commented on issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
moonming commented on issue #6513:
URL: https://github.com/apache/apisix/issues/6513#issuecomment-1059675623


   @Horus-K Can the configuration be formatted? for better reading, thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Horus-K commented on issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
Horus-K commented on issue #6513:
URL: https://github.com/apache/apisix/issues/6513#issuecomment-1059747110


   ```
   {
       "uris":[
           "/micro/app/read",
           "/micro/app/read/"
       ],
       "name":"read1",
       "vars":[
           [
               "arg_corpid",
               "IN",
               [
                   "wwef5a06cd2931632c"
               ]
           ],
           [
               "arg_appId",
               "==",
               "1411"
           ]
       ],
       "plugins":{
           "redirect":{
               "ret_code":302,
               "uri":"https://xxxxxxxx"
           }
       },
       "status":1
   }
   {
       "uris":[
           "/micro/app/read",
           "/micro/app/read/"
       ],
       "name":"read2",
       "vars":[
           [
               "arg_corpid",
               "IN",
               [
                   "wwef5a06cd2931632c"
               ]
           ],
           [
               "arg_appid",
               "==",
               "1411"
           ]
       ],
       "plugins":{
           "redirect":{
               "ret_code":307,
               "uri":"https://xxxxxx"
           }
       },
       "status":1
   }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Horus-K commented on issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
Horus-K commented on issue #6513:
URL: https://github.com/apache/apisix/issues/6513#issuecomment-1059746841


   {
       "uris":[
           "/micro/app/read",
           "/micro/app/read/"
       ],
       "name":"read2",
       "vars":[
           [
               "arg_corpid",
               "IN",
               [
                   "wwef5a06cd2931632c"
               ]
           ],
           [
               "arg_appid",
               "==",
               "1411"
           ]
       ],
       "plugins":{
           "redirect":{
               "ret_code":307,
               "uri":"https://xxxxxx/"
           }
       },
       "status":1
   }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] soulbird commented on issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
soulbird commented on issue #6513:
URL: https://github.com/apache/apisix/issues/6513#issuecomment-1060066821


   Can you provide more detailed steps to reproduce?The following is the method I tried, and the situation you said did not occur, the routing is indeed case-sensitive。
   1、create route with `arg_appId` and thren request the uri
   ```shell
   curl http://127.0.0.1:9080/apisix/admin/routes/5 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
   {
       "uris":[
           "/micro/app/read",
           "/micro/app/read/"
       ],
       "name":"read1",
       "vars":[
           [
               "arg_corpid",
               "IN",
               [
                   "wwef5a06cd2931632c"
               ]
           ],
           [
               "arg_appId",
               "==",
               "1411"
           ]
       ],
       "plugins":{
           "redirect":{
               "ret_code":302,
               "uri":"https://bigId"
           }
       },
       "status":1
   }'
   ```
   
   ```shell
   curl -v '127.0.0.1:9080//micro/app/read?appId=1411&corpid=wwef5a06cd2931632c'
   *   Trying 127.0.0.1:9080...
   * Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
   > GET //micro/app/read?appId=1411&corpid=wwef5a06cd2931632c HTTP/1.1
   > Host: 127.0.0.1:9080
   > User-Agent: curl/7.77.0
   > Accept: */*
   > 
   * Mark bundle as not supporting multiuse
   < HTTP/1.1 302 Moved Temporarily
   < Date: Sun, 06 Mar 2022 23:38:21 GMT
   < Content-Type: text/html
   < Content-Length: 142
   < Connection: keep-alive
   < Location: https://bigId
   < Server: APISIX/2.12.0
   < 
   ....
   ```
   ```shell
   curl -v '127.0.0.1:9080//micro/app/read?appid=1411&corpid=wwef5a06cd2931632c'
   *   Trying 127.0.0.1:9080...
   * Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
   > GET //micro/app/read?appid=1411&corpid=wwef5a06cd2931632c HTTP/1.1
   > Host: 127.0.0.1:9080
   > User-Agent: curl/7.77.0
   > Accept: */*
   > 
   * Mark bundle as not supporting multiuse
   < HTTP/1.1 404 Not Found
   < Date: Sun, 06 Mar 2022 23:38:30 GMT
   < Content-Type: text/plain; charset=utf-8
   < Transfer-Encoding: chunked
   < Connection: keep-alive
   < Server: APISIX/2.12.0
   < 
   ```
   
   2、create route with `arg_appid`, and then request the uri
   ```shell
   curl http://127.0.0.1:9080/apisix/admin/routes/6 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
   {
       "uris":[
           "/micro/app/read",
           "/micro/app/read/"
       ],
       "name":"read2",
       "vars":[
           [
               "arg_corpid",
               "IN",
               [
                   "wwef5a06cd2931632c"
               ]
           ],
           [
               "arg_appid",
               "==",
               "1411"
           ]
       ],
       "plugins":{
           "redirect":{
               "ret_code":307,
               "uri":"https://smallId"
           }
       },
       "status":1
   }'
   ```
   ```shell
   curl -v '127.0.0.1:9080//micro/app/read?appId=1411&corpid=wwef5a06cd2931632c'
   *   Trying 127.0.0.1:9080...
   * Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
   > GET //micro/app/read?appId=1411&corpid=wwef5a06cd2931632c HTTP/1.1
   > Host: 127.0.0.1:9080
   > User-Agent: curl/7.77.0
   > Accept: */*
   > 
   * Mark bundle as not supporting multiuse
   < HTTP/1.1 302 Moved Temporarily
   < Date: Sun, 06 Mar 2022 23:39:09 GMT
   < Content-Type: text/html
   < Content-Length: 142
   < Connection: keep-alive
   < Location: https://bigId
   < Server: APISIX/2.12.0
   < 
   ...
   ```
   ```shell
   curl -v '127.0.0.1:9080//micro/app/read?appid=1411&corpid=wwef5a06cd2931632c'
   *   Trying 127.0.0.1:9080...
   * Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
   > GET //micro/app/read?appid=1411&corpid=wwef5a06cd2931632c HTTP/1.1
   > Host: 127.0.0.1:9080
   > User-Agent: curl/7.77.0
   > Accept: */*
   > 
   * Mark bundle as not supporting multiuse
   < HTTP/1.1 307 Temporary Redirect
   < Date: Sun, 06 Mar 2022 23:39:19 GMT
   < Content-Type: text/html; charset=utf-8
   < Content-Length: 168
   < Connection: keep-alive
   < Location: https://smallId
   < Server: APISIX/2.12.0
   < 
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #6513:
URL: https://github.com/apache/apisix/issues/6513#issuecomment-1059943129


   The vars will use `ctx.var`, which is case sensitive in https://github.com/apache/apisix/blob/492f782d9fae719b3a20e0d65c275962bcdcaab9/apisix/core/ctx.lua#L244


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #6513:
URL: https://github.com/apache/apisix/issues/6513#issuecomment-1058994360


   @soulbird
   Could you take a look?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Horus-K removed a comment on issue #6513: bug: Can't match both upper and lower case arguments

Posted by GitBox <gi...@apache.org>.
Horus-K removed a comment on issue #6513:
URL: https://github.com/apache/apisix/issues/6513#issuecomment-1059746922


   `{
       "uris":[
           "/micro/app/read",
           "/micro/app/read/"
       ],
       "name":"read1",
       "vars":[
           [
               "arg_corpid",
               "IN",
               [
                   "wwef5a06cd2931632c"
               ]
           ],
           [
               "arg_appId",
               "==",
               "1411"
           ]
       ],
       "plugins":{
           "redirect":{
               "ret_code":302,
               "uri":"https://xxxxxxxx/"
           }
       },
       "status":1
   }`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org