diff --git a/rockspec/apisix-master-0.rockspec b/rockspec/apisix-master-0.rockspec index 5f49530d..30280970 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 1e1b460b..8499c0cd 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]