From 3b52451be8e12dabe89e2f7b2b1e638ecd31d1cf Mon Sep 17 00:00:00 2001 From: Ian Bicking Date: Thu, 2 Sep 2010 02:50:21 -0500 Subject: Do not set Content-Encoding to 'None' (http://trac.pythonpaste.org/pythonpaste/ticket/427) --- paste/fileapp.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'paste/fileapp.py') 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 -- cgit v1.2.1