Ian Bicking avatar Ian Bicking committed 604e76c

Do not set Content-Encoding to 'None' (http://trac.pythonpaste.org/pythonpaste/ticket/427)

Comments (0)

Files changed (1)

             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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.