You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(router): preserve rewrite-phase query argument changes during servlet URI normalization #13983
#13982 fixes query-string loss when apisix.normalize_uri_like_servlet is enabled by appending the current $is_args$args value to $upstream_uri.
Problem
$upstream_uri is materialized before route rewrite and access plugins run. Some plugins modify the live request arguments later. For example, key-auth and jwt-auth remove a query credential through ngx.req.set_uri_args() when hide_credentials is enabled.
Because $upstream_uri already contains a copy of the earlier query string, those later argument changes are not reflected in the URI sent upstream.
Example:
Incoming request: /echo?auth=secret&foo=1
Early upstream_uri: /echo?auth=secret&foo=1
Arguments after key-auth: foo=1
URI sent upstream: /echo?auth=secret&foo=1
Expected upstream URI: /echo?foo=1
The same ordering can affect other plugins that modify request arguments after servlet URI normalization.
Expected behavior
Servlet-style path normalization should preserve the path parameters while the final upstream URI observes query argument changes made by rewrite or access plugins. A plugin that explicitly sets $upstream_uri should continue to take precedence.
Suggested direction
Keep the servlet path separately, then serialize the current $is_args$args value after the relevant plugin phases have completed. Do not overwrite an $upstream_uri explicitly set by a plugin.
Add a regression test covering:
apisix.normalize_uri_like_servlet: true
query-based key-auth or jwt-auth
hide_credentials: true
an unrelated query argument that must still reach the upstream
18. But @guoqqqi sir I have worked on the above and my pr is approved ?
Hi, @Ankit-cs Sorry for the confusion. I’ll ask @ruanweihong-aaa to help move your PR review forward and assist with anything needed to get it merged, rather than redo your work.
Activity
Ankit-cs commentedon Oct 13, 2026
Assign this to me
Ankit-cs commentedon Oct 15, 2026
thanks @Baoyuantop sir
fix(router): preserve rewrite-phase query argument changes during ser…
Ankit-cs commentedon Oct 20, 2026
Hey @Baoyuantop sir can you look for the above pr
fix(router): preserve rewrite-phase query argument changes during ser…
fix(router): preserve rewrite-phase query argument changes during ser…
ruanweihong-aaa commentedon Oct 29, 2026
I’ll take this forward.
Ankit-cs commentedon Oct 29, 2026
But @guoqqqi sir I have worked on the above and my pr is approved ?
guoqqqi commentedon Oct 29, 2026
Hi, @Ankit-cs Sorry for the confusion. I’ll ask @ruanweihong-aaa to help move your PR review forward and assist with anything needed to get it merged, rather than redo your work.
Ankit-cs commentedon Oct 29, 2026
OK @guoqqqi sir