This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 3f66fab  fix: resolve unambiguous fully-qualified domain name(FQDN), 
i.e. ended in a dot (#5999)
3f66fab is described below

commit 3f66fab63ecffa7bf4d5bdb02ce8a688a4285709
Author: seven dickens <[email protected]>
AuthorDate: Wed Jan 5 09:32:13 2022 +0800

    fix: resolve unambiguous fully-qualified domain name(FQDN), i.e. ended in a 
dot (#5999)
---
 rockspec/apisix-master-0.rockspec |  2 +-
 t/node/upstream-domain.t          | 48 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/rockspec/apisix-master-0.rockspec 
b/rockspec/apisix-master-0.rockspec
index 883cd42..6e391d0 100644
--- a/rockspec/apisix-master-0.rockspec
+++ b/rockspec/apisix-master-0.rockspec
@@ -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",
diff --git a/t/node/upstream-domain.t b/t/node/upstream-domain.t
index 63069fd..2cf71dd 100644
--- a/t/node/upstream-domain.t
+++ b/t/node/upstream-domain.t
@@ -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]

Reply via email to