Title: git handler: 500 on double-slash in URL (PATH_INFO not normalized) · Issue #373 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: git handler: 500 on double-slash in URL (PATH_INFO not normalized) · Issue #373 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: git handler: 500 on double-slash in URL (PATH_INFO not normalized) · Issue #373 · JavaScriptSolidServer/JavaScriptSolidServer
Description: The git smart-HTTP handler doesn't normalize multi-slash sequences in the URL path before forwarding it as `PATH_INFO` to `git http-backend`. `http-backend` then rejects the path as "aliased" and JSS replies with a 500. Same shape as #13...
Open Graph Description: The git smart-HTTP handler doesn't normalize multi-slash sequences in the URL path before forwarding it as `PATH_INFO` to `git http-backend`. `http-backend` then rejects the path as "aliased" and J...
X Description: The git smart-HTTP handler doesn't normalize multi-slash sequences in the URL path before forwarding it as `PATH_INFO` to `git http-backend`. `http-backend` then rejects the path as "alias...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/373
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"git handler: 500 on double-slash in URL (PATH_INFO not normalized)","articleBody":"The git smart-HTTP handler doesn't normalize multi-slash sequences in the URL path before forwarding it as \\`PATH_INFO\\` to \\`git http-backend\\`. \\`http-backend\\` then rejects the path as \\\"aliased\\\" and JSS replies with a 500.\n\nSame shape as #131 (double-slash → 500), but the fix in #360 only covered \\`src/utils/url.js\\`. \\`src/handlers/git.js\\` builds \\`urlPath\\` independently and was never updated.\n\n## Symptom\n\nFrontend at jss.live/git/ accepts a repo URL with a trailing slash (e.g. \\`https://melvin.me/melvin/public/git/test/\\`), then appends \\`/info/refs?service=git-upload-pack\\` to compose the smart-HTTP probe — yielding \\`/melvin/public/git/test//info/refs\\`. JSS forwards that path through to \\`git http-backend\\` unmodified.\n\npm2 stderr from the failing request on melvin.me running v0.0.170:\n\n\\`\\`\\`\ngit http-backend stderr: fatal: '/melvin/public/git/test//info/refs': aliased\n\\`\\`\\`\n\nThe browser sees \\`HTTP 500\\` and \\\"Failed to load resource\\\".\n\n## Reproduction\n\n\\`\\`\\`bash\n# bare repo at test-repo.git/ — works\ncurl -sI 'https://melvin.me/melvin/public/git/test-repo.git/info/refs?service=git-upload-pack'\n# HTTP/2 200, application/x-git-upload-pack-advertisement\n\n# same repo, double slash injected — 500\ncurl -sI 'https://melvin.me/melvin/public/git/test-repo.git//info/refs?service=git-upload-pack'\n# HTTP/2 500\n\\`\\`\\`\n\n## Fix\n\nCollapse multi-slash sequences in \\`urlPath\\` at the top of \\`handleGit\\` (and reuse the cleaned value for \\`PATH_INFO\\`):\n\n\\`\\`\\`js\nlet urlPath = decodeURIComponent(request.url.split('?')[0]);\nurlPath = urlPath.replace(/\\/{2,}/g, '/'); // mirror the fix in src/utils/url.js (#131)\n\\`\\`\\`\n\nSame regex \\`extractRepoPath\\` already does for the leading slash, but applied across the whole path so \\`PATH_INFO\\` is clean too.\n\n## Refs\n\n- #131 — original double-slash bug (LDP path, fixed in #360)\n- #371 — \\`Git-Protocol\\` CORS header (recently shipped in v0.0.170)\n- \\`src/handlers/git.js:104\\` — where \\`urlPath\\` is built","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-08T01:20:37Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/373"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a52877ac-5307-b388-6269-1a15e335f207 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9AE8:3D4AFB:6EF5F2:8C358F:6B039652 |
| html-safe-nonce | 58c410900baa66dec79d5f65a75e5c51bc37883008a51cfc8bf87c87c2223187 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUU4OjNENEFGQjo2RUY1RjI6OEMzNThGOjZCMDM5NjUyIiwidmlzaXRvcl9pZCI6IjI1OTk2NDE0NzcyNTI2MTc4MTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 648c28372c49d3fb2b483ce5a1c717ee29781e8eeec74c96b5a3f623abce231b |
| hovercard-subject-tag | issue:4403049839 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/373/issue_layout |
| twitter:image | https://opengraph.githubassets.com/512db65646a52af7015c052454a915c3ce62f92be3072b16575b29dd9b9e5d96/JavaScriptSolidServer/JavaScriptSolidServer/issues/373 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/512db65646a52af7015c052454a915c3ce62f92be3072b16575b29dd9b9e5d96/JavaScriptSolidServer/JavaScriptSolidServer/issues/373 |
| og:image:alt | The git smart-HTTP handler doesn't normalize multi-slash sequences in the URL path before forwarding it as `PATH_INFO` to `git http-backend`. `http-backend` then rejects the path as "aliased" and J... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width