mirror of
https://gitee.com/iresty/apisix.git
synced 2024-11-30 02:57:49 +08:00
fix: resolve unambiguous fully-qualified domain name(FQDN), i.e. ended in a dot (#5999)
This commit is contained in:
parent
c6f1a83c6f
commit
3f66fab63e
@ -32,7 +32,7 @@ description = {
|
||||
|
||||
dependencies = {
|
||||
"lua-resty-ctxdump = 0.1-0",
|
||||
"lua-resty-dns-client = 5.2.0",
|
||||
"lua-resty-dns-client = 5.2.3",
|
||||
"lua-resty-template = 2.0",
|
||||
"lua-resty-etcd = 1.6.0",
|
||||
"api7-lua-resty-http = 0.2.0",
|
||||
|
48
t/node/upstream-domain.t
vendored
48
t/node/upstream-domain.t
vendored
@ -399,3 +399,51 @@ GET /t
|
||||
1980, 1981, 1981
|
||||
--- no_error_log
|
||||
[error]
|
||||
|
||||
|
||||
|
||||
=== TEST 15: set route(with upstream)
|
||||
--- 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,
|
||||
[[{
|
||||
"uri": "/hello",
|
||||
"upstream": {
|
||||
"nodes": {
|
||||
"foo.com.": 0,
|
||||
"127.0.0.1:1980": 1
|
||||
},
|
||||
"type": "roundrobin",
|
||||
"desc": "new upstream"
|
||||
},
|
||||
"service_id": "1"
|
||||
}]]
|
||||
)
|
||||
|
||||
if code >= 300 then
|
||||
ngx.status = code
|
||||
end
|
||||
ngx.say(body)
|
||||
}
|
||||
}
|
||||
--- request
|
||||
GET /t
|
||||
--- response_body
|
||||
passed
|
||||
--- no_error_log
|
||||
[error]
|
||||
|
||||
|
||||
|
||||
=== TEST 16: hit routes, parse the domain of upstream node
|
||||
--- request
|
||||
GET /hello
|
||||
--- response_body
|
||||
hello world
|
||||
--- error_log eval
|
||||
qr/dns resolver domain: foo.com. to \d+.\d+.\d+.\d+/
|
||||
--- no_error_log
|
||||
[error]
|
||||
|
Loading…
Reference in New Issue
Block a user