nodeSolidServer / nodeSolidServer/node-solid-server

HostURI is set to https even if not using https

未關閉
#696 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

bug input-needed
主要語言
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
_

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 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

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。