You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "leslie-tsang (via GitHub)" <gi...@apache.org> on 2023/03/22 01:09:44 UTC
[GitHub] [apisix] leslie-tsang commented on a diff in pull request #9112: feat: support variable when rewrite header in proxy rewrite plugin
leslie-tsang commented on code in PR #9112:
URL: https://github.com/apache/apisix/pull/9112#discussion_r1144130026
##########
apisix/core/utils.lua:
##########
@@ -335,4 +335,45 @@ end
_M.resolve_var = resolve_var
+local resolve_var_with_captures
+do
+ local _captures
+ -- escape is not supported very well, like there si a redundant '\' after escape "$1"
+ local pat = [[ (?<! \\) \$ \{? (\d+) \}? ]]
+
+ local function resolve(m)
+ local v = _captures[tonumber(m[1])]
Review Comment:
The current implementation meets the needs, seems no need to support the capture group name. :)
--
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