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

[GitHub] [apisix] zhendongcmss opened a new pull request, #9423: feat(proxy-rewrite): proxy-rewrite plugin support `vars` conditional expression

zhendongcmss opened a new pull request, #9423:
URL: https://github.com/apache/apisix/pull/9423

   proxy-rewrite plugin support `vars` conditional expression
   
   ### Description
   
   <!-- Please include a summary of the change and which issue is fixed. -->
   <!-- Please also include relevant motivation and context. -->
   
   Fixes # (issue)
   
   ### Checklist
   
   - [ ] I have explained the need for this PR and the problem it solves
   - [ ] I have explained the changes or the new features added to this PR
   - [ ] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
   
   <!--
   
   Note
   
   1. Mark the PR as draft until it's ready to be reviewed.
   2. Always add/update tests for any changes unless you have a good reason.
   3. Always update the documentation to reflect the changes made in the PR.
   4. Make a new commit to resolve conversations instead of `push -f`.
   5. To resolve merge conflicts, merge master instead of rebasing.
   6. Use "request review" to notify the reviewer after making changes.
   7. Only a reviewer can mark a conversation as resolved.
   
   -->
   


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


[GitHub] [apisix] monkeyDluffy6017 closed pull request #9423: feat(proxy-rewrite): proxy-rewrite plugin support `vars` conditional expression

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 closed pull request #9423: feat(proxy-rewrite): proxy-rewrite plugin support `vars` conditional expression
URL: https://github.com/apache/apisix/pull/9423


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


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

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9423:
URL: https://github.com/apache/apisix/pull/9423#issuecomment-1551582471

   According to @soulbird, it's an implemented feature.
   I will close this pr, feel free to reopen it.


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


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

Posted by "Fabriceli (via GitHub)" <gi...@apache.org>.
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


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

Posted by "soulbird (via GitHub)" <gi...@apache.org>.
soulbird commented on PR #9423:
URL: https://github.com/apache/apisix/pull/9423#issuecomment-1541105199

   This feature is already implemented: https://github.com/apache/apisix/blob/master/docs/en/latest/terminology/plugin.md#custom-plugin-priority


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