incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1544547 - /sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java
Date Fri, 22 Nov 2013 14:13:22 GMT
Author: bdelacretaz
Date: Fri Nov 22 14:13:22 2013
New Revision: 1544547

URL: http://svn.apache.org/r1544547
Log:
SLING-3255 - fix off-by-one error in Range header handling

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=1544547&r1=1544546&r2=1544547&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
Fri Nov 22 14:13:22 2013
@@ -512,8 +512,10 @@ public class StreamRendererServlet exten
     */
     private void copy(InputStream istream, OutputStream ostream,
             Range range) throws IOException {
-        log.debug("copy: Serving bytes: {}-{}", range.start, range.end);
-        staticCopyRange(istream, ostream, range.start, range.end);
+        // HTTP Range 0-9 means "byte 9 included"
+        final long endIndex = range.end + 1;
+        log.debug("copy: Serving bytes: {}-{}", range.start, endIndex);
+        staticCopyRange(istream, ostream, range.start, endIndex);
     }
 
     // static, package-private method to make unit testing easier



Mime
View raw message