You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "Fabriceli (via GitHub)" <gi...@apache.org> on 2023/05/10 01:00:54 UTC

[GitHub] [apisix] Fabriceli commented on a diff in pull request #9423: feat(proxy-rewrite): proxy-rewrite plugin support `vars` conditional expression

Fabriceli commented on code in PR #9423:
URL: https://github.com/apache/apisix/pull/9423#discussion_r1189255947


##########
apisix/plugins/proxy-rewrite.lua:
##########
@@ -233,6 +237,21 @@ do
         core.table.insert(upstream_names, name)
     end
 
+    local function vars_matched(conf, ctx)
+        if not conf.vars then
+            return true
+        end
+
+        if not conf.proxy_expr then
+            local proxy_expr, _ = expr.new(conf.vars)
+            conf.proxy_expr = proxy_expr
+        end
+
+        local match_result = conf.proxy_expr:eval(ctx.var)
+        core.log.error(match_result)

Review Comment:
   Why print the `match_result` each time as a error log?



-- 
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: notifications-unsubscribe@apisix.apache.org

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