File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -200,3 +200,38 @@ GET /t
200200--- response_body
201201match meta: metadata /asf
202202matched: {"_path":"\/bb\/cc\/*",":ext":"xx","_method":"GET","_host":"*.bar.com"}
203+
204+
205+
206+ === TEST 7: /name/*name/foo
207+ --- config
208+ location /t {
209+ content_by_lua_block {
210+ local json = require("cjson.safe")
211+ local radix = require("resty.radixtree")
212+ local rx = radix.new({
213+ {
214+ paths = {"/name/*name/foo"},
215+ metadata = "metadata /name",
216+ },
217+ })
218+
219+ local opts = {matched = {}}
220+ local meta = rx:match("/name/json/foo", opts)
221+ ngx.say("match meta: ", meta)
222+ ngx.say("matched: ", json.encode(opts.matched))
223+
224+ meta = rx:match("/name/json", opts)
225+ ngx.say("match meta: ", meta)
226+ ngx.say("matched: ", json.encode(opts.matched))
227+ }
228+ }
229+ --- request
230+ GET /t
231+ --- no_error_log
232+ [error]
233+ --- response_body
234+ match meta: metadata /name
235+ matched: {"_path":"\/name\/*name\/foo","name":"json"}
236+ match meta: nil
237+ matched: {}
You can’t perform that action at this time.
0 commit comments