bosprimigenious opened a new issue, #1077: URL: https://github.com/apache/dubbo-go-pixiu/issues/1077
## Verification checklist - [x] Searched current issues, all 12 open PR file lists and relevant closed PRs/comments; no overlapping RawPath fix found. ## Environment - Go 1.25.14, macOS arm64. - Latest `develop` at `51198ddd8d1317f6c1d7e351fde8a6be7da60d62`. - HTTP listener, `dgp.filter.http.httpproxy`, real loopback HTTP upstream, static `RoundRobin` cluster; no registry or external provider. ## Bug description HTTPProxy reconstructs the upstream URL from the decoded `r.URL.Path` without retaining its valid `RawPath`. A request for `/files/a%2Fb` reaches the upstream as `/files/a/b`, changing the path separator structure. ## Steps to reproduce 1. Run an HTTP upstream that logs or echoes its raw request URI. 2. Configure a Pixiu HTTP listener with a `/` prefix route to that upstream, using `dgp.filter.http.httpproxy` with `scheme: http` and a static RoundRobin cluster. 3. Start the normal `pixiu gateway start -c <config>` CLI. 4. Send `GET /files/a%2Fb?token=x%2Fy&token=z` to the listener, preserving the percent escapes. I ran the actual CLI gateway and TCP loopback upstream, with no monkeypatches, against 12 inputs. The upstream observed: | Sent to gateway | Observed upstream | | --- | --- | | `/files/a%2Fb?token=x%2Fy&token=z` | `/files/a/b?token=x%2Fy&token=z` | | `/files/a%2fb?encoded=%252F` | `/files/a/b?encoded=%252F` | | `/files/dot%2Ename?z=3` | `/files/dot.name?z=3` | | `/files/tilde%7euser?x=%7e` | `/files/tilde~user?x=%7e` | The query, ordinary paths, `%25`, `%3F`, `%23`, `%252F` and Unicode controls were preserved. A double-slash input was already redirected with 301 by the listener; that is a separate pre-existing control, not this filter defect. All query values here are synthetic. ## Expected behavior Forward the original escaped path when it remains a valid encoding of the current decoded path. After a path rewrite, stale or invalid RawPath must still fall back to the rewritten Path. This matches Go’s [`net/url.URL.EscapedPath` contract](https://pkg.go.dev/net/url#URL.EscapedPath). ## Possible solution Carry `r.URL.RawPath` alongside `r.URL.Path` when constructing the upstream `url.URL`. Go’s URL serialization already validates the RawPath hint. No new decoding or query processing is needed. Investigation and this issue were prepared with OpenAI Codex. The local gateway reproduction does not establish complete Linux/Docker/RISC-V acceptance. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
