Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
3.4.0
-
None
-
marmotta-3.4.0-SNAPSHOT; Tomcat7 - executed with: mvn tomcat7:run
Operating System: Linux
Description
CONSTRUCT-Sparql-Request fails with "no result format specified or unsupported format".
In SparqlWebService.select an extensive request header parsing is done to determine the best content type to use for the response.
Reason: in the above environment - the method
List<String> acceptHeaders = EnumerationUtils.toList(request.getHeaders(ACCEPT));
does not produce a list with each requested accept header, instead a list with a single entry containing all accept headers is created - example below:
"application/n-triples;q=0.7, text/plain;q=0.7, application/rdf+xml;q=0.8, application/xml;q=0.8, text/turtle, application/x-turtle, application/trig;q=0.8, application/x-trig;q=0.8"
This string is then further parsed with
List<ContentType> acceptedTypes = HttpMarmottaUtils.parseAcceptHeaders(List<String>)
where the string is split into tokens. Problem: the leading space after each comma (",") is not stripped!!
Solution: in MarmottaHttpUtils.java, method "parseContentType", each token should be trimmed - line 132.
String mt[] = c.trim().split(";");
Just provided the patch to "develop" branch