njh / redstore

RedStore is a lightweight RDF triplestore written in C using the Redland library.
https://www.aelius.com/njh/redstore/
GNU General Public License v3.0
62 stars 6 forks source link

Bad handling of POST request with content-type application/sparql-query #58

Open Hibou57 opened 7 years ago

Hibou57 commented 7 years ago

When I send a request to /sparql/ with Content-Type: application/sparql-query and the unencoded request as the request body, RedStore erroneously concludes the request is malformed, complaining:

Response: Bad Request - Missing query string.

But with this query form, not query string are required, although there may be some, as stated in 2.1.3 query via POST directly:

[…] Clients may include the optional default-graph-uri and named-graph-uri parameters as HTTP query string parameters in the request URI. […]

njh commented 7 years ago

Hi,

I have not done any work on RedStore for quite a long time, so I am unlikely to make time to fix this. If you are able to create a Pull Request (ideally with a test), then I will be happy to review it.

Be warned that there also hasn't been a release of Redland since 2013.

nick.

Hibou57 commented 7 years ago

Yah :p , will have a look when I will have time.

But (on the second point) Redland ins't dead, isn’t it? Thanks for the hint anyway, I will care when I will read the W3C references on the covered standards.

Hibou57 commented 7 years ago

4store do the same, just that it returns an HTTP error status and an explanatory response body:

HTTP/1.0 400 4store only implements application/x-www-form-urlencoded Server: 4s-httpd/fe34829 Content-Type: text/plain; charset=UTF-8

400 4store only implements application/x-www-form-urlencoded This is a 4store SPARQL server fe34829