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 2022/06/24 06:30:39 UTC

[GitHub] [apisix] panhow commented on a diff in pull request #7317: bugfix: when both route and global rules setted proxy-rewrite plugin,…

panhow commented on code in PR #7317:
URL: https://github.com/apache/apisix/pull/7317#discussion_r905756805


##########
apisix/plugins/proxy-rewrite.lua:
##########
@@ -185,6 +185,7 @@ function _M.rewrite(conf, ctx)
         upstream_uri = core.utils.uri_safe_encode(upstream_uri)
     end
 
+    ctx.var.upstream_uri = nil

Review Comment:
   it DOES NOT a good fix, but works
   
   actually there are two problems to fix:
   1. `proxy-rewrite` should not set `ctx.var.upstream_uri` when the `uri` or `regex_uri` isn't set
   2. `ngx.var.xxx` can be set once at the time when `ctx.var.xxx` is first assign, after the metamthod `__newIndex` run , other assignment won't pass to the `ngx.var.xxx`



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