Open the file in binary mode -- so serving images from a Windows box
might actually work.
This commit is contained in:
parent
08833f2a6d
commit
391c8b4ea2
|
@ -64,7 +64,7 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
|||
self.send_error(403, "Directory listing not supported")
|
||||
return None
|
||||
try:
|
||||
f = open(path)
|
||||
f = open(path, 'rb')
|
||||
except IOError:
|
||||
self.send_error(404, "File not found")
|
||||
return None
|
||||
|
|
Loading…
Reference in New Issue