Title: In subdomain mode, files at the base-domain root are unreachable (401) · Issue #307 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: In subdomain mode, files at the base-domain root are unreachable (401) · Issue #307 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: In subdomain mode, files at the base-domain root are unreachable (401) · Issue #307 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Problem With subdomains: true + baseDomain: solid.social, any file at the base domain's root returns 401 even with a public-read ACL. The root container itself (GET /) works; direct file access (GET /mashlib.js, /index.html, /terms.html)...
Open Graph Description: Problem With subdomains: true + baseDomain: solid.social, any file at the base domain's root returns 401 even with a public-read ACL. The root container itself (GET /) works; direct file access (GE...
X Description: Problem With subdomains: true + baseDomain: solid.social, any file at the base domain's root returns 401 even with a public-read ACL. The root container itself (GET /) works; direct file access...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/307
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"In subdomain mode, files at the base-domain root are unreachable (401)","articleBody":"## Problem\n\nWith `subdomains: true` + `baseDomain: solid.social`, any file at the base domain's root returns 401 even with a public-read ACL. The root container itself (`GET /`) works; direct file access (`GET /mashlib.js`, `/index.html`, `/terms.html`) does not.\n\n## Root cause\n\n`buildResourceUrl` in `src/auth/middleware.js` rewrites the resource URL when the request hits the base domain:\n\n```js\nif (subdomainsEnabled && hostname === baseDomain && !podName) {\n const pathMatch = urlPath.match(/^\\/([^/]+)(\\/.*)?$/);\n if (pathMatch && !pathMatch[1].startsWith('.')) {\n const podName = pathMatch[1];\n const remainder = pathMatch[2] || '/';\n return `${protocol}://${podName}.${baseDomain}${remainder}`;\n }\n}\n```\n\nFor `GET solid.social/mashlib.js`:\n- Path matches → podName = `mashlib.js`\n- Returns `https://mashlib.js.solid.social/`\n- ACL check is now against a domain that doesn't exist\n- Root ACL (`accessTo: https://solid.social/`) doesn't match → 401\n\n## Reproduction\n\nOn a JSS with `subdomains: true` + `baseDomain` set:\n\n```sh\n# Works — base domain container\ncurl -I https://DOMAIN/ # 200\n\n# All fail — base domain files\ncurl -I https://DOMAIN/mashlib.js # 401\ncurl -I https://DOMAIN/index.html # 401\ncurl -I https://DOMAIN/any-file.txt # 401\n```\n\n## Impact\n\nCore assets (`mashlib.js`, `mashlib.css`) hosted at the base domain become unreachable, breaking the data browser for pods on that server. Operators can work around by moving assets to a subdomain or CDN, but the default setup is broken.\n\n## Proposed fix\n\nOnly treat a path segment as a pod name if it can't be served directly. Options:\n\n1. **Check file existence first** — if `data/${segment}` exists as a file, serve it directly\n2. **Pattern exemption** — treat anything with a file extension (`.js`, `.css`, `.html`, etc.) as a file, not a pod\n3. **Explicit allow-list** — operators can list reserved root paths\n\n(1) is the most correct but requires storage lookup in the auth middleware. (2) is a fast pragmatic fix: `if (pathMatch[1].includes('.'))` → don't rewrite.\n\n## Context\n\nFound while debugging why mashlib wasn't loading on solid.social. `mashlib.js.acl` and `mashlib.css.acl` were both present with public-read rules but still returning 401 — because the rules apply to `https://solid.social/mashlib.js` but the ACL checker was comparing against `https://mashlib.js.solid.social/`.","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-04-23T01:33:20Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/307"}
| 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:623e97a3-4769-d3a9-9e7f-2fa5474807d1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B00:3F9E09:277953C:34285A9:6B038EA5 |
| html-safe-nonce | d09cbd4d4d38327b8519b24d3e0636828d18562bd3f6b01d5817be9b616613e6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjAwOjNGOUUwOToyNzc5NTNDOjM0Mjg1QTk6NkIwMzhFQTUiLCJ2aXNpdG9yX2lkIjoiMzI5MTE3MDE1NDM3NzA4ODY3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 441ace799a41f0ace6bee4327fdcb11fe3a8dac1634bf44129c8aca4ebe1a36a |
| hovercard-subject-tag | issue:4312801342 |
| 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/307/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e5362bc6c2843f31462b1daaed694baa571070946bcdff4d8aaeaadaeaff2ae7/JavaScriptSolidServer/JavaScriptSolidServer/issues/307 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e5362bc6c2843f31462b1daaed694baa571070946bcdff4d8aaeaadaeaff2ae7/JavaScriptSolidServer/JavaScriptSolidServer/issues/307 |
| og:image:alt | Problem With subdomains: true + baseDomain: solid.social, any file at the base domain's root returns 401 even with a public-read ACL. The root container itself (GET /) works; direct file access (GE... |
| 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