Show More
@@ -160,9 +160,9 b' def staticfile(directory, fname, req):' | |||||
160 | try: |
|
160 | try: | |
161 | os.stat(path) |
|
161 | os.stat(path) | |
162 | ct = mimetypes.guess_type(path)[0] or "text/plain" |
|
162 | ct = mimetypes.guess_type(path)[0] or "text/plain" | |
163 |
|
|
163 | with open(path, 'rb') as fh: | |
164 |
data = f |
|
164 | data = fh.read() | |
165 | fp.close() |
|
165 | ||
166 | req.respond(HTTP_OK, ct, body=data) |
|
166 | req.respond(HTTP_OK, ct, body=data) | |
167 | except TypeError: |
|
167 | except TypeError: | |
168 | raise ErrorResponse(HTTP_SERVER_ERROR, 'illegal filename') |
|
168 | raise ErrorResponse(HTTP_SERVER_ERROR, 'illegal filename') |
General Comments 0
You need to be logged in to leave comments.
Login now