]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix s3server.py to stop truncating downloads of images and other non-text files 669/head
authorMichael Leonhard <mike@restbackup.com>
Mon, 21 Jan 2013 00:48:05 +0000 (16:48 -0800)
committerMichael Leonhard <mike@restbackup.com>
Mon, 21 Jan 2013 00:48:05 +0000 (16:48 -0800)
demos/s3server/s3server.py

index de56776b9133bc929ebc6d7088fdecf67321a36c..87816c3288f086b533809ffda947eaf280151f08 100644 (file)
@@ -221,7 +221,7 @@ class ObjectHandler(BaseRequestHandler):
         self.set_header("Content-Type", "application/unknown")
         self.set_header("Last-Modified", datetime.datetime.utcfromtimestamp(
             info.st_mtime))
-        object_file = open(path, "r")
+        object_file = open(path, "rb")
         try:
             self.finish(object_file.read())
         finally: