diff --git a/loris/resolver.py b/loris/resolver.py index 9c5c838f..522a6e81 100644 --- a/loris/resolver.py +++ b/loris/resolver.py @@ -298,7 +298,8 @@ def cached_file_for_ident(self, ident): def cache_file_extension(self, ident, response): if 'content-type' in response.headers: try: - extension = self.get_format(ident, constants.FORMATS_BY_MEDIA_TYPE[response.headers['content-type']]) + content_type = response.headers['content-type'].split(';')[0] + extension = self.get_format(ident, constants.FORMATS_BY_MEDIA_TYPE[content_type]) except KeyError: logger.warn('Your server may be responding with incorrect content-types. Reported %s for ident %s.', response.headers['content-type'], ident)