leslie-tsang commented on code in PR #9112:
URL: https://github.com/apache/apisix/pull/9112#discussion_r1145538773
##########
apisix/plugins/proxy-rewrite.lua:
##########
@@ -278,15 +284,24 @@ function _M.rewrite(conf, ctx)
local uri, _, err = re_sub(upstream_uri, conf.regex_uri[1],
conf.regex_uri[2], "jo")
- if uri then
- upstream_uri = uri
- else
+ if not uri then
local msg = "failed to substitute the uri " .. ctx.var.uri ..
" (" .. conf.regex_uri[1] .. ") with " ..
conf.regex_uri[2] .. " : " .. err
core.log.error(msg)
return 500, {message = msg}
end
+
+ local m, err = re_match(upstream_uri, conf.regex_uri[1], "jo")
+ if not m then
+ if err then
Review Comment:
```suggestion
if not m and err then
```
Would be better ? Seems no necessary to separate them.
--
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]