You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/07/15 08:47:30 UTC

[GitHub] [incubator-apisix] moonming commented on a change in pull request #1795: feature: expose API for dns resolving

moonming commented on a change in pull request #1795:
URL: https://github.com/apache/incubator-apisix/pull/1795#discussion_r454892966



##########
File path: apisix/init.lua
##########
@@ -630,5 +630,18 @@ function _M.stream_log_phase()
     run_plugin("log")
 end
 
+do
+    local dns_resolver_cache = core.lrucache.new({
+        ttl = 30, count = 512, invalid_stale = true,
+    })
+
+    function _M.dns_resolve(hostname)
+        if ipmatcher.parse_ipv4(hostname) or
+                ipmatcher.parse_ipv6(hostname) then
+            return hostname
+        end

Review comment:
       need test cases for those codes.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org