should return content-length when requesting range, and that

content-length should be the range specified in the url (i.e.,
range/1024 has length 1024)
This commit is contained in:
Adam Ginsburg (keflavich)
2016-12-24 13:41:52 -07:00
parent cff242d46f
commit b4677d7466
+5 -2
View File
@@ -598,7 +598,8 @@ def range_request(numbytes):
response = Response(headers={
'ETag' : 'range%d' % numbytes,
'Accept-Ranges' : 'bytes',
'Content-Range' : 'bytes */%d' % numbytes
'Content-Range' : 'bytes */%d' % numbytes,
"Content-Length": str(numbytes),
})
response.status_code = 416
return response
@@ -625,7 +626,9 @@ def range_request(numbytes):
'Content-Type': 'application/octet-stream',
'ETag' : 'range%d' % numbytes,
'Accept-Ranges' : 'bytes',
'Content-Range' : content_range }
"Content-Length": str(numbytes),
'Content-Range' : content_range
}
response = Response(generate_bytes(), headers=response_headers)