Syntax error when SPARQL Insert request is too large

未關閉
#1,628 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
javascript, nodejs
領域
api, backend

研究方向

先追蹤 NSS 對 application/sparql-update 請求的 PATCH 處理以及請求大小錯誤路徑,然後重現所提供的大型 INSERT 範例。完成的標準是:在支援時處理該請求,或是回傳 HTTP 413 Request Entity Too Large,而不是誤導性的語法錯誤。

由索引模型根據 Issue 內容生成。

描述

When sending PATCH request with a really large SPARQL Insert body, NSS responds with http code 400 and the following response body:

Patch document syntax error: Line 1 of <https://pod.example/resource>: Bad syntax:
   Unknown syntax at start of statememt: '[object Object]'
   at: "[object Object]"

This response is very misleading, since it asserts that I did send an invalid syntax

Expected behaviour

NSS should either process the request successfully, or respond with 413 Request Entity Too Large.

Steps to reproduce

Send something like this to NSS:

PATCH https://pod.example/resource
content-type: application/sparql-update
authorization: DPoP <token>
dpop: <dpop>

INSERT DATA {
</> <> "".
</> <> "".
</> <> "".
</> <> "".
</> <> "".
... round about 10.000 more of this ...
}

Is this really practically relevant?

Yes, see https://github.com/codecentric/web-clip/issues/7

First we had an actual syntax error. After fixing it, same response on NSS but this time just too large.

Depending on the page, WebClip might do really large insert requests. If we got a 413 we could at least handle it properly

主要語言
JavaScript
星號
1.8k
分支
308
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

nodeSolidServer/node-solid-server 的其他 Issue

查看 nodeSolidServer/node-solid-server 的全部 Issue

相似的 Issue

更多 JavaScript Issue

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

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