Baoyuantop commented on issue #12442: URL: https://github.com/apache/apisix/issues/12442#issuecomment-3086564280
This is the expected result. When processing header values, APISIX calls the `core.utils.resolve_var` function to replace variables. This function uses the regular expression `(?<!\\)\$(\{(\w+)\}|(\w+))` to match variables in the format of `$variable` or `${variable}`. When a variable is matched but does not exist in the context, it is replaced by an empty string. This is not a bug, but a design feature of APISIX. This feature allows using Nginx variables in header values (such as `$request_id`, `$remote_addr`, etc.), but the side effect is that any string containing a `$` sign followed by alphanumeric characters will be treated as a variable. I can't think of a good solution. Currently, you can only avoid using the `$` symbol in the string, or further encode the string. Looking forward to other people's ideas -- 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-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org