Skip to content

Commit

Permalink
test: add get_path case
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 committed Dec 8, 2021
1 parent 51ea55f commit 8cf2e06
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions t/core/request.t
Original file line number Diff line number Diff line change
Expand Up @@ -464,3 +464,29 @@ POST /hello
POST
--- no_error_log
[error]


=== TEST 14: get_path
--- config
location / {
content_by_lua_block {
local core = require("apisix.core")
local ngx_ctx = ngx.ctx
local api_ctx = ngx_ctx.api_ctx
if api_ctx == nil then
api_ctx = core.tablepool.fetch("api_ctx", 0, 32)
ngx_ctx.api_ctx = api_ctx
end

core.ctx.set_vars_meta(api_ctx)

local path = core.request.get_path(ngx.ctx.api_ctx)
ngx.say(path)
}
}
--- request
GET /hello/test?a=b&b=a
--- response_body
/hello/test
--- no_error_log
[error]

0 comments on commit 8cf2e06

Please sign in to comment.