jiangfucheng commented on code in PR #10112:
URL: https://github.com/apache/apisix/pull/10112#discussion_r1312474453


##########
apisix/core/utils.lua:
##########
@@ -375,5 +377,28 @@ 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.info("external server func to: " .. addr .. func_name ..
+            ", body: " .. json.encode(body))
+        local httpc = http.new()
+        local res, err = httpc:request_uri(addr .. func_name, {
+            method = "POST",

Review Comment:
   Would it be possible to replace this constant with a parameter? This would 
increase flexibility.



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