nodeSolidServer / nodeSolidServer/node-solid-server
HostURI is set to https even if not using https
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 1.8k
- 派生
- 308
- PR 合并指标
- 30 天内没有已合并 PR
描述
Tim Berners-Lee @timbl 10:21
There is a bug in NSS where it assumes somewhere that it is running as https: and not http:. when making the base URI of a document for parsing.
targetKB.statementsMatching(st.subject, st.predicate, st.object, target)
[]
targetKB.statementsMatching(st.subject, st.predicate, st.object, null)
[]
targetKB.statementsMatching(null, st.predicate, st.object, target)
(2) [Statement, Statement]
targetKB.statementsMatching(null, st.predicate, st.object, target)[0].subject.uri
"https://localhost:3080/timbl/Public/Test/2018/Cascade%20test/SFO%20LHR/Test%20long%20chat/index.ttl#SharedPreferences"
targetKB.statementsMatching(null, st.predicate, st.object, target)[1].subject.uri
"https://localhost:3080/timbl/Public/Test/2018/Cascade%20test/SFO%20LHR/Test%20long%20chat/index.ttl#id1527249837545"
st.subject
NamedNode {termType: "NamedNode", value: "http://localhost:3080/timbl/Public/Test/2018/Casca…HR/Test%20long%20chat/index.ttl#SharedPreferences"}
st.subject.uri
"http://localhost:3080/timbl/Public/Test/2018/Cascade%20test/SFO%20LHR/Test%20long%20chat/index.ttl#SharedPreferences"
That is debug console output in the PATCH handler
A statement in the store jas a subject which starts https: instead of http: — as a result the PATCH fails 409 as it can’t find the triple to delete it.
Yes @RubenVerborgh this is an example of where having a single mapping place from filename to URI and back may have avoided this.
Ruben Verborgh @RubenVerborgh 10:29
Aha! We had a very similar bug earlier. On the road now, but will check later today.
Do you have more details?
Tim Berners-Lee @timbl 10:34
The above is a deep dive to where the issue shows itself..in fact you can see it in he log
solid:handlers PATCH -- Reading https://localhost:3080/timbl/Public/Test/2018/Cascade%20test/SFO%20LH
bzzzzt thats wrong
There is a strange line
target.uri = utils.getBaseUri(req) + req.originalUrl
locals.host.serverUri : "https://localhost:8443"
That is wrong
Maybe from here: https://github.com/solid/node-solid-server/blob/master/config/defaults.js#L12
Maybe that is where the https: originates from
Tim Berners-Lee @timbl 11:14
I guess the fault is basically in https://github.com/solid/node-solid-server/blob/master/lib/models/solid-host.js
_
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
阅读 lib/models/solid-host.js 和 config/defaults.js,然后跟踪 utils.getBaseUri(req) 在 PATCH handler 中的调用路径。将请求 URL 和 locals.host.serverUri 与解析后的 statements 中存储的 URI 进行比较。完成的标准是非 HTTPS 请求保留其 http scheme,并且 PATCH 能找到要删除的 triple。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- backend
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100