[Mulgara-svn] r1534 - trunk/src/jar/querylang/java/org/mulgara/protocol/http

alexhall at mulgara.org alexhall at mulgara.org
Fri Feb 20 21:44:47 UTC 2009


Author: alexhall
Date: 2009-02-20 13:44:47 -0800 (Fri, 20 Feb 2009)
New Revision: 1534

Modified:
   trunk/src/jar/querylang/java/org/mulgara/protocol/http/ProtocolServlet.java
Log:
Use the correct MIME content type in the SPARQL protocol response.

Modified: trunk/src/jar/querylang/java/org/mulgara/protocol/http/ProtocolServlet.java
===================================================================
--- trunk/src/jar/querylang/java/org/mulgara/protocol/http/ProtocolServlet.java	2009-02-20 19:19:11 UTC (rev 1533)
+++ trunk/src/jar/querylang/java/org/mulgara/protocol/http/ProtocolServlet.java	2009-02-20 21:44:47 UTC (rev 1534)
@@ -378,12 +378,12 @@
    * @throws InternalErrorException Due to an error accessing the answer.
    */
   <T> void send(Map<Output,? extends StreamConstructor<T>> builders, T data, Output type, HttpServletResponse resp) throws IOException, BadRequestException, InternalErrorException {
-    resp.setContentType(CONTENT_TYPE);
-    resp.setHeader("pragma", "no-cache");
-
     // establish the output type
     if (type == null) type = DEFAULT_OUTPUT_TYPE;
 
+    resp.setContentType(type.mimeText);
+    resp.setHeader("pragma", "no-cache");
+
     // get the constructor for the stream outputter
     StreamConstructor<T> constructor = builders.get(type);
     if (constructor == null) throw new BadRequestException("Unknown result type: " + type);




More information about the Mulgara-svn mailing list