jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpfis...@apache.org
Subject svn commit: r1378543 - /jackrabbit/oak/trunk/oak-mk-remote/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java
Date Wed, 29 Aug 2012 13:32:37 GMT
Author: dpfister
Date: Wed Aug 29 13:32:36 2012
New Revision: 1378543

URL: http://svn.apache.org/viewvc?rev=1378543&view=rev
Log:
Provide a content-type from read() unless requested from a browser

Modified:
    jackrabbit/oak/trunk/oak-mk-remote/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java

Modified: jackrabbit/oak/trunk/oak-mk-remote/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-remote/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java?rev=1378543&r1=1378542&r2=1378543&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-remote/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java
(original)
+++ jackrabbit/oak/trunk/oak-mk-remote/src/main/java/org/apache/jackrabbit/mk/server/MicroKernelServlet.java
Wed Aug 29 13:32:36 2012
@@ -323,6 +323,11 @@ class MicroKernelServlet {
             long pos = request.getParameter("pos", 0L);
             int length = request.getParameter("length", -1);
 
+            if (request.getUserAgent() == null) {
+                // let browsers guess the correct file format
+                response.setContentType("application/octet-stream");
+            }
+            
             OutputStream out = response.getOutputStream();
             if (pos == 0L && length == -1) {
                 /* return the complete binary */



Mime
View raw message