equal
deleted
inserted
replaced
79 # Real production environment should use dedicated static file serving. |
79 # Real production environment should use dedicated static file serving. |
80 self._cw.set_header('last-modified', generateDateTime(os.stat(path).st_mtime)) |
80 self._cw.set_header('last-modified', generateDateTime(os.stat(path).st_mtime)) |
81 self._cw.validate_cache() |
81 self._cw.validate_cache() |
82 # XXX elif uri.startswith('/https/'): uri = uri[6:] |
82 # XXX elif uri.startswith('/https/'): uri = uri[6:] |
83 mimetype, encoding = mimetypes.guess_type(path) |
83 mimetype, encoding = mimetypes.guess_type(path) |
|
84 if mimetype is None: |
|
85 mimetype = 'application/octet-stream' |
84 self._cw.set_content_type(mimetype, osp.basename(path), encoding) |
86 self._cw.set_content_type(mimetype, osp.basename(path), encoding) |
85 with open(path, 'rb') as resource: |
87 with open(path, 'rb') as resource: |
86 return resource.read() |
88 return resource.read() |
87 |
89 |
88 @property |
90 @property |