leslie-tsang commented on code in PR #10112:
URL: https://github.com/apache/apisix/pull/10112#discussion_r1309556628


##########
apisix/core/utils.lua:
##########
@@ -24,12 +24,14 @@ local core_str       = require("apisix.core.string")
 local rfind_char     = core_str.rfind_char
 local table          = require("apisix.core.table")
 local log            = require("apisix.core.log")
+local json            = require("apisix.core.json")

Review Comment:
   ```suggestion
   local json           = require("apisix.core.json")
   ```



##########
apisix/core/utils.lua:
##########
@@ -24,12 +24,14 @@ local core_str       = require("apisix.core.string")
 local rfind_char     = core_str.rfind_char
 local table          = require("apisix.core.table")
 local log            = require("apisix.core.log")
+local json            = require("apisix.core.json")
 local string         = require("apisix.core.string")
 local dns_client     = require("apisix.core.dns.client")
 local ngx_re         = require("ngx.re")
 local ipmatcher      = require("resty.ipmatcher")
 local ffi            = require("ffi")
 local base           = require("resty.core.base")
+local http           = require "resty.http"

Review Comment:
   ```suggestion
   local http           = require("resty.http")
   ```



##########
apisix/core/utils.lua:
##########
@@ -375,5 +377,27 @@ end
 -- Resolve {$1, $2, ...} in the given string
 _M.resolve_var_with_captures = resolve_var_with_captures
 
+local function server_func(func_name, body, headers)
+    local local_conf = config_local.local_conf()
+
+    if local_conf.apisix and local_conf.apisix.server_func_addr
+            and local_conf.apisix.server_func_addr ~= "" then

Review Comment:
   ```suggestion
       if local_conf.apisix and local_conf.apisix.server_func_addr
          and local_conf.apisix.server_func_addr ~= ""
       then
   ```
   Would be better ?



##########
apisix/core/utils.lua:
##########
@@ -375,5 +377,27 @@ end
 -- Resolve {$1, $2, ...} in the given string
 _M.resolve_var_with_captures = resolve_var_with_captures
 
+local function server_func(func_name, body, headers)
+    local local_conf = config_local.local_conf()
+
+    if local_conf.apisix and local_conf.apisix.server_func_addr
+            and local_conf.apisix.server_func_addr ~= "" then
+        local addr = local_conf.apisix.server_func_addr
+        if not string.has_suffix(addr, "/") then
+            addr = addr .. "/"
+        end
+        log.warn("external server func to: " .. addr .. func_name .. ", body: 
" .. json.encode(body))

Review Comment:
   would be better to use `info` level ? seems no need to use `warn` as default.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to