You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2014/07/21 15:38:03 UTC

[07/16] git commit: fix webservice response for empty SPARQL query (MARMOTTA-511)

fix webservice response for empty SPARQL query (MARMOTTA-511)


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/bd6f585f
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/bd6f585f
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/bd6f585f

Branch: refs/heads/ldp
Commit: bd6f585fec50e8566ffd92d25be6b7f5f816ab56
Parents: 2b0b846
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Tue Jul 8 10:32:27 2014 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Tue Jul 8 10:32:27 2014 +0200

----------------------------------------------------------------------
 .../marmotta/platform/sparql/webservices/SparqlWebService.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/bd6f585f/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java b/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
index a3d7f88..e10168c 100644
--- a/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
+++ b/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
@@ -230,7 +230,7 @@ public class SparqlWebService {
 	            if (acceptHeader.contains("html")) {
 	                return Response.seeOther(new URI(configurationService.getServerUri() + "sparql/admin/squebi.html")).build();
 	            } else {
-	            	return Response.status(Response.Status.BAD_REQUEST).entity("no SPARQL query specified").build();
+	            	return Response.status(Status.ACCEPTED).entity("no SPARQL query specified").build();
 	            }
 	    	} else {
 	    		//query duck typing
@@ -389,7 +389,7 @@ public class SparqlWebService {
                 if (parseSubType(resultType).equals("html"))
                     return Response.seeOther(new URI(configurationService.getServerUri() + "sparql/admin/update.html")).build();
                 else
-                    return Response.status(Response.Status.BAD_REQUEST).entity("no SPARQL query specified").build();
+                    return Response.status(Status.ACCEPTED).entity("no SPARQL query specified").build();
             }
         } catch (MalformedQueryException ex) {
             return Response.status(Response.Status.BAD_REQUEST).entity(WebServiceUtil.jsonErrorResponse(ex)).build();