##// END OF EJS Templates
Fix static file serving over HTTP on Windows....
Wojciech Milkowski -
r3244:f045b049 default
parent child Browse files
Show More
@@ -38,7 +38,7 b' def staticfile(directory, fname, req):'
38 ct = mimetypes.guess_type(path)[0] or "text/plain"
38 ct = mimetypes.guess_type(path)[0] or "text/plain"
39 req.header([('Content-type', ct),
39 req.header([('Content-type', ct),
40 ('Content-length', os.path.getsize(path))])
40 ('Content-length', os.path.getsize(path))])
41 return file(path).read()
41 return file(path, 'rb').read()
42 except (TypeError, OSError):
42 except (TypeError, OSError):
43 # illegal fname or unreadable file
43 # illegal fname or unreadable file
44 return ""
44 return ""
General Comments 0
You need to be logged in to leave comments. Login now