incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1003815 - /sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java
Date Sat, 02 Oct 2010 15:31:48 GMT
Author: fmeschbe
Date: Sat Oct  2 15:31:48 2010
New Revision: 1003815

URL: http://svn.apache.org/viewvc?rev=1003815&view=rev
Log:
SLING-1814 Response level Content-Length should only be set if for full transmission or single
range. For multiple ranges with a multipart response the Content-Length header must not be
set.

Modified:
    sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java?rev=1003815&r1=1003814&r2=1003815&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java
Sat Oct  2 15:31:48 2010
@@ -223,6 +223,8 @@ public class StreamRendererServlet exten
             if (ranges == FULL) {
 
                 // return full resource
+                setContentLength(response,
+                    resource.getResourceMetadata().getContentLength());
                 byte[] buf = new byte[IO_BUFFER_SIZE];
                 int rd;
                 while ((rd = stream.read(buf)) >= 0) {
@@ -341,8 +343,6 @@ public class StreamRendererServlet exten
         if (encoding != null) {
             response.setCharacterEncoding(encoding);
         }
-
-        setContentLength(response, meta.getContentLength());
     }
 
     /**



Mime
View raw message