Skip to content

Commit

Permalink
simple string find and add string domain hosts test
Browse files Browse the repository at this point in the history
  • Loading branch information
theweakgod committed Nov 29, 2023
1 parent aaf9ee6 commit df43dea
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions t/add.t
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,30 @@ GET /t
--- response_body
pass
true
=== TEST 3: test domain and port
--- config
location /t {
content_by_lua_block {
local opts = {vars = {server_port = 9080, handler}, host="www.foo.com"}
local radix = require("resty.radixtree")
local rx = radix.new({
{
paths = {"/aa*"},
hosts = "www.foo.com:9080",
handler = function (ctx)
ngx.say("pass")
end
}
})
ngx.say(rx:dispatch("/aa", opts))
}
}
--- request
GET /t
--- no_error_log
[error]
--- response_body
pass
true

0 comments on commit df43dea

Please sign in to comment.