nodeSolidServer / nodeSolidServer/node-solid-server
Syntax error when SPARQL Insert request is too large
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.8k
- Forks
- 308
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing NSS's PATCH handling for application/sparql-update requests and the request-size error path, then reproduce the supplied large INSERT example. Done means the request is processed when supported or returns HTTP 413 Request Entity Too Large instead of a misleading syntax error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100