fix(forward-auth): extra_headers not resolving variable on $post_arg.#12435
Merged
Revolyssup merged 5 commits intoapache:masterfrom Jul 29, 2025
Merged
fix(forward-auth): extra_headers not resolving variable on $post_arg.#12435Revolyssup merged 5 commits intoapache:masterfrom
Revolyssup merged 5 commits intoapache:masterfrom
Conversation
kayx23
reviewed
Jul 18, 2025
| if core.request.header(ctx, \"tenant_id\") then | ||
| local tenant_id = core.request.header(ctx, \"tenant_id\") | ||
| if tenant_id == \"123\" then | ||
| core.response.set_header(\"X-User-ID\", \"i-am-an-user\"); |
Member
There was a problem hiding this comment.
Maybe remove this line to avoid any confusion? Since users will not actually observe this response header in this example.
Contributor
Author
There was a problem hiding this comment.
This is required to pass/deny the request. Users don't need to care about it. This is forward-auth server simulated.
Co-authored-by: Traky Deng <trakydeng@gmail.com>
nic-6443
previously approved these changes
Jul 22, 2025
bzp2010
requested changes
Jul 22, 2025
nic-6443
previously approved these changes
Jul 23, 2025
bzp2010
reviewed
Jul 23, 2025
bzp2010
reviewed
Jul 25, 2025
bzp2010
approved these changes
Jul 29, 2025
nic-6443
approved these changes
Jul 29, 2025
membphis
approved these changes
Jul 29, 2025
jizhuozhi
pushed a commit
to jizhuozhi/apisix
that referenced
this pull request
Oct 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing regex in util.resolve_var doesn't handle all the variable cases properly. For eg: when passed with $post_arg.xyz, it fails to resolve the variable. So regex is being modified to support the aforementioned key.
This was not caught previously because the test cases didn't assert the values properly.
Checklist