qlever icon indicating copy to clipboard operation
qlever copied to clipboard

Ignore HTTP Query parameters for POST Requests

Open Qup42 opened this issue 7 months ago • 2 comments

The calls to UrlParser::parseGetRequestTarget should strip the HTTP Query Parameters before appending the Query/Update.

This can cause problems with queries like:

  1. an URL-encoded POST to /?
  2. a direct POST with additional query parameters, for example, /?default-graph-uri=... Both lead to the query or update not being processed and an incorrect error message.

We'd get the target /??update=... or /?default-graphi-uri=...?query=... both of which are invalid and not handled correctly. This PR fixes that by ignoring these query parameters. AFAIK these have also been ignored quietly before.

Further information on the cases:

  1. can occur with some libraries (namely rdflib) which send direct POSTs for updates to /?. I haven't observed this for queries.
  2. These are syntactically valid but unsupported queries.

Qup42 avatar Jul 25 '24 13:07 Qup42