mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 16:36:20 +00:00
Don't send header if it makes no sense to do so.
This commit is contained in:
parent
b049d4a792
commit
7466ee25a8
@ -329,6 +329,9 @@ class HTTPServer(object):
|
|||||||
data = bucket.read(offset, end - offset)
|
data = bucket.read(offset, end - offset)
|
||||||
|
|
||||||
request.setResponseCode(http.PARTIAL_CONTENT)
|
request.setResponseCode(http.PARTIAL_CONTENT)
|
||||||
|
if len(data):
|
||||||
|
# For empty bodies the content-range header makes no sense since
|
||||||
|
# the end of the range is inclusive.
|
||||||
request.setHeader(
|
request.setHeader(
|
||||||
"content-range",
|
"content-range",
|
||||||
ContentRange("bytes", offset, offset + len(data)).to_header(),
|
ContentRange("bytes", offset, offset + len(data)).to_header(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user