You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by me...@apache.org on 2020/08/16 08:32:40 UTC

[apisix] branch master updated: update radixtree to version 2.2 . (#2061)

This is an automated email from the ASF dual-hosted git repository.

membphis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new c2a7359  update radixtree to version 2.2 . (#2061)
c2a7359 is described below

commit c2a7359b2773a946b80e66c48c6d24697273e6f5
Author: YuanSheng Wang <me...@gmail.com>
AuthorDate: Sun Aug 16 16:32:29 2020 +0800

    update radixtree to version 2.2 . (#2061)
    
    fix #2058
    
    * fixed test
---
 rockspec/apisix-master-0.rockspec |  2 +-
 t/node/route-parameter-uri.t      | 70 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 71 insertions(+), 1 deletion(-)

diff --git a/rockspec/apisix-master-0.rockspec b/rockspec/apisix-master-0.rockspec
index 5f49530..3028097 100644
--- a/rockspec/apisix-master-0.rockspec
+++ b/rockspec/apisix-master-0.rockspec
@@ -41,7 +41,7 @@ dependencies = {
     "lua-resty-cookie = 0.1.0",
     "lua-resty-session = 2.24",
     "opentracing-openresty = 0.1",
-    "lua-resty-radixtree = 2.1",
+    "lua-resty-radixtree = 2.2",
     "lua-protobuf = 0.3.1",
     "lua-resty-openidc = 1.7.2-1",
     "luafilesystem = 1.7.0-2",
diff --git a/t/node/route-parameter-uri.t b/t/node/route-parameter-uri.t
index 1e1b460..8499c0c 100644
--- a/t/node/route-parameter-uri.t
+++ b/t/node/route-parameter-uri.t
@@ -126,3 +126,73 @@ GET /name/json/bar
 qr/404 Not Found/
 --- no_error_log
 [error]
+
+
+
+=== TEST 7: set routeļ¼Œuri=/:name/foo
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/routes/1',
+                ngx.HTTP_PUT,
+                [[{
+                    "upstream": {
+                        "nodes": {
+                            "127.0.0.1:1980": 1
+                        },
+                        "type": "roundrobin"
+                    },
+                    "uri": "/:name/foo"
+                }]],
+                [[{
+                    "node": {
+                        "value": {
+                            "uri": "/:name/foo",
+                            "upstream": {
+                                "nodes": {
+                                    "127.0.0.1:1980": 1
+                                },
+                                "type": "roundrobin"
+                            }
+                        },
+                        "key": "/apisix/routes/1"
+                    },
+                    "action": "set"
+                }]]
+                )
+
+            if code >= 300 then
+                ngx.status = code
+            end
+            ngx.say(body)
+        }
+    }
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 8: /json/foo
+--- request
+GET /json/foo
+--- error_code: 404
+--- response_body eval
+qr/404 Not Found/
+--- no_error_log
+[error]
+
+
+
+=== TEST 9: /json/bbb/foo
+--- request
+GET /json/bbb/foo
+--- error_code: 404
+--- response_body
+{"error_msg":"failed to match any routes"}
+--- no_error_log
+[error]