From: Attila-Mihaly Balazs Date: Mon, 24 Mar 2014 11:07:33 +0000 (+0200) Subject: Allow for missing content types X-Git-Tag: live~25^2 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/1157280cd8ff44da57a37dfc2f5920e53180f6b4?hp=542237960ac6a2520792ae8b63821d901455d808 Allow for missing content types --- diff --git a/forum/views/meta.py b/forum/views/meta.py index a47cf1d..e7d1515 100644 --- a/forum/views/meta.py +++ b/forum/views/meta.py @@ -37,7 +37,7 @@ def static(request, title, content): def media(request, skin, path): response = serve(request, "%s/media/%s" % (skin, path), document_root=os.path.join(os.path.dirname(os.path.dirname(__file__)), 'skins').replace('\\', '/')) - content_type = response['Content-Type'] + content_type = response.get('Content-Type', '') if ('charset=' not in content_type): if (content_type.startswith('text') or content_type=='application/x-javascript'): content_type += '; charset=utf-8'