Mercurial > piecrust2
comparison piecrust/serving/server.py @ 551:f2b875ecc940
serve: Werkzeug docs say you need to pass a flag with `wrap_file`.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 08 Aug 2015 15:55:24 -0700 |
parents | b22e69ff54f4 |
children | 9612cfc6455a |
comparison
equal
deleted
inserted
replaced
550:6f216c1ab6b1 | 551:f2b875ecc940 |
---|---|
399 _, ext = os.path.splitext(path) | 399 _, ext = os.path.splitext(path) |
400 response.set_etag(etag) | 400 response.set_etag(etag) |
401 response.last_modified = datetime.datetime.fromtimestamp(mtime) | 401 response.last_modified = datetime.datetime.fromtimestamp(mtime) |
402 response.mimetype = self._mimetype_map.get( | 402 response.mimetype = self._mimetype_map.get( |
403 ext.lstrip('.'), 'text/plain') | 403 ext.lstrip('.'), 'text/plain') |
404 response.direct_passthrough = True | |
404 return response | 405 return response |
405 | 406 |
406 def _handle_error(self, exception, environ, start_response): | 407 def _handle_error(self, exception, environ, start_response): |
407 code = 500 | 408 code = 500 |
408 if isinstance(exception, HTTPException): | 409 if isinstance(exception, HTTPException): |