AlinsRan commented on PR #13626:
URL: https://github.com/apache/apisix/pull/13626#issuecomment-4888988561

   Good catch — the leak was real. Fixed in 64f9c2fec.
   
   The encoded-slash uri is now a router-match-only value: it is swapped into 
`ctx.var.uri` just for the dispatch call and restored immediately after, so the 
rewrite/access phases and plugins (proxy-rewrite, authz-casbin, OPA, etc.) keep 
seeing the normalized `ctx.var.uri`. Only the matched route and its captured 
params (`uri_param_*`) retain `%2F`.
   
   On the upstream: nginx forwards the original request line through the 
variable `proxy_pass`, so the upstream receives the raw `%2F`. That is inherent 
nginx behavior, independent of this option and of `ctx.var.uri` — without the 
option the request would not have matched at all. (The docs/config wording was 
corrected in 479927e41, which previously mis-stated that the upstream gets the 
decoded uri.)
   
   Regression test: with `match_uri_encoded_slash=true`, a 
`serverless-pre-function` rewrite hook observes `uri=/pv/a/b/list` while 
`uri_param_id` is still `a%2Fb`; TEST 13 asserts the upstream receives 
`/v1/up%2Fstream/...` unchanged.


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