{"id":"XE-13358","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"503","source_url":"https://github.com/xeprotocol/xe/issues/503","reporter_id":2484,"title":"test.network proxy and direct node route the same URL path differently (trailing-slash / %2e%2e normalization divergence)","area":"ops-testnet","claimed_tier":"minor","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":null,"status":"triaging","closed_reason":null,"github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:11.121473+00:00","updated_at":"2026-11-20T00:17:11.815353+00:00","source_created_at":"2026-11-12T08:59:25+00:00","told_at":"2026-11-20T00:15:44+00:00","status_changed_at":"2026-11-20T00:15:30.045942+00:00","url":"https://bounty.xe.network/XE-13358","body":"## Summary\n\nThe two documented-equivalent API surfaces — the versioned proxy (`https://test.network/api/v1`) and the direct node (`https://ldn.core.test.network`) — route the *same URL path* to different results, because the proxy normalizes the URL (trailing slash, `%2e%2e` dot-segments, `..` collapsing) while the node does not.\n\n## Where\n\n- Proxy: `https://test.network/api/v1/*` (nginx front, normalizes path before forwarding).\n- Direct: `https://ldn.core.test.network/*` (Go `http.ServeMux`, no normalization).\n- OpenAPI states both expose \"the same JSON HTTP API\" (`servers` list marks them equivalent).\n\n## What I observed\n\n| Request | direct node | proxy |\n|---|---|---|\n| `GET /node/` (trailing slash) | `404 page not found` | `200` (or `308` redirect) — full node info |\n| `GET /statechain/kv/` (empty wildcard) | `400 {\"error\":\"missing key\"}` | `200` full governance KV map |\n| `GET /statechain/kv/sys.network_id/` (trailing slash) | `404 {\"error\":\"key not found\"}` | `200 {key:sys.network_id, value:testnet-0005}` |\n| `GET /statechain/kv/%2e%2e/sys.network_id` | `404 \"key not found\"` (literal key) | `404 {\"code\":\"not_found\",\"message\":\"No API route at /api/v1/statechain/sys.network_id\"}` (nginx decoded `%2e%2e` → `../` and collapsed it) |\n\nThe proxy strips trailing slashes and decodes/collapses dot-segments before forwarding; the node treats both literally (`{key...}` wildcard, exact path match).\n\n## Impact\n\nIntegrations that pin one surface cannot rely on equivalent routing between the two — a path that resolves on the proxy 404s (or hits a different handler) on the direct node and vice-versa. It is a consistency/interpretation conflict between the two advertised-equivalent surfaces. No auth or trusted-boundary escape: `%2e%2e` collapses *inside* `/api/v1` (it does not escape the `/api` prefix or reach another service; `/api/v1/../../node` → SPA 404).\n\n## Reproduce\n\n```bash\ncurl -s -o /dev/null -w '%{http_code}\\n' https://ldn.core.test.network/node/\ncurl -s -o /dev/null -w '%{http_code}\\n' https://test.network/api/v1/node/\n```\n\n## Severity\n\nMinor — inconsistent API responses / path-equivalence divergence between the two documented-equivalent surfaces.","patch_refs":[{"id":558,"repo":"xeprotocol/xe","kind":"pr","ref":"505","title":"fix(api): normalize URL path and resolve dot segments across handlers (fixes #503)","url":"https://github.com/xeprotocol/xe/pull/505","note":"","state":"open","author":"arturbarszcz78","added_by":"desk","created_at":"2026-11-14T20:42:20.110489+00:00"}],"thread":[{"id":12922,"source":"github","source_ref":"7026050506","author":"Joseph Denne","team":true,"body":"Thanks for the report. We have read it and are checking how the hosted proxy handles these paths against what the node does. We will update this ticket when there is more to share.","created_at":"2026-11-20T00:15:44+00:00"}]}