update radixtree to version 2.2 . (#2061)

fix #2058

* fixed test
This commit is contained in:
YuanSheng Wang 2020-08-16 16:32:29 +08:00 committed by GitHub
parent 7525f1fcc9
commit c2a7359b27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 71 additions and 1 deletions

View File

@ -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",

View File

@ -126,3 +126,73 @@ GET /name/json/bar
qr/404 Not Found/
--- no_error_log
[error]
=== TEST 7: set routeuri=/: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]