getPod() assumes subdomain pattern, breaks path-based pods
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
调研方向
从 src/utils/headerFooterHelpers.ts 中的 getPod() 开始,检查 authn.currentUser()、WebID 数据和 storage 在周边工具函数中是如何可用的。使用类似 http://server.com/alice/ 的基于路径的 pod 验证其行为,并保留现有的、针对子域名 pod 的基于 origin 的 fallback。
由索引模型根据 Issue 内容生成。
描述
Problem
The getPod() function in src/utils/headerFooterHelpers.ts assumes pods are at the origin (subdomain pattern), which breaks path-based pod servers.
Current code (line 17-20):
export function getPod (): NamedNode {
// @@ TODO: This is given that mashlib runs on NSS - might need to change when we want it to run on other Pod servers
return sym(document.location.origin).site()
}
The TODO comment acknowledges this limitation.
Impact
When using a path-based pod server (e.g., http://server.com/alice/), after login:
- WebID:
http://server.com/alice/profile/card#me✓ getPod()returns:http://server.com/✗- Profile guess becomes:
http://server.com/profile/card#me✗ - Should be:
http://server.com/alice/profile/card#me✓
This causes 404 errors when mashlib tries to load the user's profile.
Affected Servers
- Any path-based pod server
- CSS (Community Solid Server) supports both subdomain and path patterns
- JSS (JavaScript Solid Server) uses path pattern
Suggested Fix
Derive the pod root from the logged-in user's WebID rather than assuming document.location.origin:
export function getPod (): NamedNode {
const user = authn.currentUser()
if (user) {
// Extract pod root from WebID's pim:storage or by convention
const storage = getStorage(user)
if (storage) return storage
}
// Fallback to origin-based (subdomain pattern)
return sym(document.location.origin).site()
}
Or use the pim:storage triple from the user's profile which explicitly declares the pod root.
Environment
- solid-ui version: latest (via mashlib CDN)
- Server: JSS (JavaScript Solid Server) with path-based pods
- 主要语言
- TypeScript
- 星标
- 153
- 派生
- 46
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 7
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SolidOS/solid-ui 的其他 Issue
-
enhancement
-
enhancement
-
Vite warning 未关闭enhancement
难度 3/5 1-2 天 新手友好度 64/100
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
-
enhancement
相似的 Issue
-
blocklist removal
难度 2/5 1-3 小时 新手友好度 65/100
MetaMask/eth-phishing-detect#296544 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
pastelsky/bundlephobia#1122 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100