nodeSolidServer / nodeSolidServer/node-solid-server

Syntax error when SPARQL Insert request is too large

オープン
#1,628 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
JavaScript
スター
1.8k
フォーク
308
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、application/sparql-update リクエストに対する NSS の PATCH 処理と、リクエストサイズのエラーパスを追跡し、次に提供された大きな INSERT の例を再現します。対応している場合はリクエストが処理され、対応していない場合は誤解を招く構文エラーではなく HTTP 413 Request Entity Too Large を返せば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, nodejs
領域
api, backend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。