mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
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:
+5
-2
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user