Commits

Jan-Wijbrand Kolman  committed b3f56e5

respond with 206 partial content whenever a range was requested

  • Participants
  • Parent commits 97b66f5

Comments (0)

Files changed (1)

File paste/fileapp.py

         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:
+        if range or content_length != self.content_length:
+            start_response('206 Partial Content', headers)
+        else:
             start_response('200 OK', headers)
-        else:
-            start_response('206 Partial Content', headers)
         if self.content is not None:
             return [self.content[lower:upper+1]]
         return (lower, content_length)