diff options
| -rw-r--r-- | CONTRIBUTORS.txt | 2 | ||||
| -rw-r--r-- | pyramid/static.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 2654801c3..a449333cb 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -156,3 +156,5 @@ Contributors - Ken Manheimer, 2011/11/07 - Reed O'Brien, 2011/11/07 + +- Klee Dienes, 2011/10/30 diff --git a/pyramid/static.py b/pyramid/static.py index 50a8b918b..2a9abbd8f 100644 --- a/pyramid/static.py +++ b/pyramid/static.py @@ -43,10 +43,11 @@ class _FileResponse(Response): def __init__(self, path, cache_max_age): super(_FileResponse, self).__init__(conditional_response=True) self.last_modified = getmtime(path) - content_type = mimetypes.guess_type(path, strict=False)[0] + content_type, content_encoding = mimetypes.guess_type(path, strict=False) if content_type is None: content_type = 'application/octet-stream' self.content_type = content_type + self.content_encoding = content_encoding content_length = getsize(path) self.app_iter = _FileIter(open(path, 'rb'), content_length) # assignment of content_length must come after assignment of app_iter |
