summaryrefslogtreecommitdiff
path: root/paste/fileapp.py
diff options
context:
space:
mode:
authorJan-Wijbrand Kolman <devnull@localhost>2013-03-25 19:44:54 +0100
committerJan-Wijbrand Kolman <devnull@localhost>2013-03-25 19:44:54 +0100
commit70271d404f900f2c12fcb383779e948f069b4fc3 (patch)
treefbf854d2cea366e7fcbab1b4ab8b99ba697abb96 /paste/fileapp.py
parent767cadb9250d4fa3c5968b54e2676a3ff5079551 (diff)
downloadpaste-70271d404f900f2c12fcb383779e948f069b4fc3.tar.gz
respond with 206 partial content whenever a range was requested
Diffstat (limited to 'paste/fileapp.py')
-rw-r--r--paste/fileapp.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/paste/fileapp.py b/paste/fileapp.py
index 8432511..6c42072 100644
--- a/paste/fileapp.py
+++ b/paste/fileapp.py
@@ -158,10 +158,10 @@ class DataApp(object):
CONTENT_RANGE.update(headers, first_byte=lower, last_byte=upper,
total_length = self.content_length)
CONTENT_LENGTH.update(headers, content_length)
- if content_length == self.content_length:
- start_response('200 OK', headers)
- else:
+ if range or content_length != self.content_length:
start_response('206 Partial Content', headers)
+ else:
+ start_response('200 OK', headers)
if self.content is not None:
return [self.content[lower:upper+1]]
return (lower, content_length)