Ankit-cs commented on PR #14040:
URL: https://github.com/apache/apisix/pull/14040#issuecomment-6337314587

   Hi @ruanweihong-aaa ,
    I have updated the PR to resolve both issues:
   
   1. Preserve unrelated upstream parameters in `data-mask` 
(`apisix/plugins/data-mask.lua`):
      - We now parse and decode the query string directly from 
`ctx.var.upstream_uri` via `core.string.decode_args()`, rather than overwriting 
it with client request arguments.
      - Masking rules are applied to these upstream arguments, ensuring 
unrelated parameters (such as `fixed=1` added by `proxy-rewrite`) and repeated 
values (`tag=a&tag=b`) are fully preserved in `$upstream_uri` logs.
      - Added regression tests in `t/plugin/data-mask.t` (TEST 35 & 36) 
verifying that `proxy-rewrite` parameters and repeated values are preserved 
while sensitive query arguments are sanitized.
   
   2. Fix route matching in `t/router/servlet-upstream-uri.t`:
      - Changed the `data-mask-test` route from `uri = "/data-mask/*"` to the 
exact path `uri = "/data-mask"`.
      - Requests to `/data-mask;jsessionid=x` now accurately match the intended 
route instead of falling back to `/*`, properly triggering `data-mask` and 
`file-logger`.
   
    Could you please take another look when you have a moment?
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to