You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "membphis (via GitHub)" <gi...@apache.org> on 2026/09/23 03:14:07 UTC

[I] fix(router): preserve rewrite-phase query argument changes during servlet URI normalization [apisix]

membphis opened a new issue, #13983:
URL: https://github.com/apache/apisix/issues/13983

   ### Background
   
   #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:
   
   ```text
   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
   
   ### Related
   
   - #13982
   


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] fix(router): preserve rewrite-phase query argument changes during servlet URI normalization [apisix]

Posted by "ruanweihong-aaa (via GitHub)" <gi...@apache.org>.
ruanweihong-aaa commented on issue #13983:
URL: https://github.com/apache/apisix/issues/13983#issuecomment-6492350270

   I’ll take this forward.


-- 
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


Re: [I] fix(router): preserve rewrite-phase query argument changes during servlet URI normalization [apisix]

Posted by "Ankit-cs (via GitHub)" <gi...@apache.org>.
Ankit-cs commented on issue #13983:
URL: https://github.com/apache/apisix/issues/13983#issuecomment-6494258682

   OK @guoqqqi sir 


-- 
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


Re: [I] fix(router): preserve rewrite-phase query argument changes during servlet URI normalization [apisix]

Posted by "guoqqqi (via GitHub) via notifications" <no...@apisix.apache.org>.
guoqqqi closed issue #13983: fix(router): preserve rewrite-phase query argument changes during servlet URI normalization
URL: https://github.com/apache/apisix/issues/13983


-- 
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


Re: [I] fix(router): preserve rewrite-phase query argument changes during servlet URI normalization [apisix]

Posted by "Ankit-cs (via GitHub)" <gi...@apache.org>.
Ankit-cs commented on issue #13983:
URL: https://github.com/apache/apisix/issues/13983#issuecomment-6188462562

   thanks @Baoyuantop sir


-- 
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


Re: [I] fix(router): preserve rewrite-phase query argument changes during servlet URI normalization [apisix]

Posted by "Ankit-cs (via GitHub)" <gi...@apache.org>.
Ankit-cs commented on issue #13983:
URL: https://github.com/apache/apisix/issues/13983#issuecomment-6138015899

   Assign this to me 


-- 
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


Re: [I] fix(router): preserve rewrite-phase query argument changes during servlet URI normalization [apisix]

Posted by "guoqqqi (via GitHub)" <gi...@apache.org>.
guoqqqi commented on issue #13983:
URL: https://github.com/apache/apisix/issues/13983#issuecomment-6493801764

   > 18\. But [@guoqqqi](https://github.com/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.


-- 
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


Re: [I] fix(router): preserve rewrite-phase query argument changes during servlet URI normalization [apisix]

Posted by "Ankit-cs (via GitHub)" <gi...@apache.org>.
Ankit-cs commented on issue #13983:
URL: https://github.com/apache/apisix/issues/13983#issuecomment-6290191576

   Hey @Baoyuantop sir can you look for the above pr


-- 
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


Re: [I] fix(router): preserve rewrite-phase query argument changes during servlet URI normalization [apisix]

Posted by "Ankit-cs (via GitHub)" <gi...@apache.org>.
Ankit-cs commented on issue #13983:
URL: https://github.com/apache/apisix/issues/13983#issuecomment-6493382976

   But @guoqqqi sir I have worked on the above and my pr is approved ?


-- 
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