diff options
| -rw-r--r-- | paste/fileapp.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/paste/fileapp.py b/paste/fileapp.py index 8a0e8a1..8432511 100644 --- a/paste/fileapp.py +++ b/paste/fileapp.py @@ -339,8 +339,13 @@ class ArchiveStore(object): exc = HTTPNotFound("Path requested, '%s', is not a file." % path) return exc.wsgi_application(environ, start_response) content_type, content_encoding = mimetypes.guess_type(info.filename) - app = DataApp(None, content_type = content_type, - content_encoding = content_encoding) + # 'None' is not a valid content-encoding, so don't set the header if + # mimetypes.guess_type returns None + if content_encoding is not None: + app = DataApp(None, content_type = content_type, + content_encoding = content_encoding) + else: + app = DataApp(None, content_type = content_type) app.set_content(self.archive.read(path), time.mktime(info.date_time + (0,0,0))) self.cache[path] = app |
