diff options
author | Ian Bicking <ianb@colorstudy.com> | 2010-09-02 02:50:21 -0500 |
---|---|---|
committer | Ian Bicking <ianb@colorstudy.com> | 2010-09-02 02:50:21 -0500 |
commit | 3b52451be8e12dabe89e2f7b2b1e638ecd31d1cf (patch) | |
tree | dc6acfb85ae90c0d89e3e7e1a6e4e21b315e25db /paste/fileapp.py | |
parent | 7428650dc1484e426e69002bb4b17cac3f6b8e73 (diff) | |
download | paste-3b52451be8e12dabe89e2f7b2b1e638ecd31d1cf.tar.gz |
Do not set Content-Encoding to 'None' (http://trac.pythonpaste.org/pythonpaste/ticket/427)
Diffstat (limited to 'paste/fileapp.py')
-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 |