]> git.openstreetmap.org Git - osqa.git/commitdiff
Allow for missing content types
authorAttila-Mihaly Balazs <dify.ltd@gmail.com>
Mon, 24 Mar 2014 11:07:33 +0000 (13:07 +0200)
committerAttila-Mihaly Balazs <dify.ltd@gmail.com>
Mon, 24 Mar 2014 11:07:33 +0000 (13:07 +0200)
forum/views/meta.py

index a47cf1d8bbc5f04ffbae53c942c41d4e0842e414..e7d151588a8402a6e0c2b73c19cf03b9005e91c0 100644 (file)
@@ -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'