🐛 fix Content-Range header for partial response according to http spec (http://bit.ly/content-range)

This commit is contained in:
Alexey Danilov
2015-10-23 18:53:57 +03:00
parent c5cf254b74
commit 14ac4a98b1
4 changed files with 6 additions and 6 deletions

View File

@@ -66,7 +66,7 @@ class HttpProxyCache extends ProxyCache {
.append(request.partial ? "HTTP/1.1 206 PARTIAL CONTENT\n" : "HTTP/1.1 200 OK\n")
.append("Accept-Ranges: bytes\n")
.append(lengthKnown ? String.format("Content-Length: %d\n", contentLength) : "")
.append(addRange ? String.format("Content-Range: bytes %d-%d/%d\n", request.rangeOffset, length, length) : "")
.append(addRange ? String.format("Content-Range: bytes %d-%d/%d\n", request.rangeOffset, length - 1, length) : "")
.append(mimeKnown ? String.format("Content-Type: %s\n", mime) : "")
.append("\n") // headers end
.toString();