summaryrefslogtreecommitdiffstats
path: root/flatpages
diff options
context:
space:
mode:
authorMartin <devnull@localhost>2012-08-14 15:05:15 +0200
committerMartin <devnull@localhost>2012-08-14 15:05:15 +0200
commit951f88a59a9ed591b6ede995cf652c854bde5373 (patch)
tree60e234b712965904dea924b85e842442d0d9a5a3 /flatpages
parent28047277f1fb0679c3b94bb5a14d2384a94cc27f (diff)
downloadtroggle-951f88a59a9ed591b6ede995cf652c854bde5373.tar.gz
troggle-951f88a59a9ed591b6ede995cf652c854bde5373.tar.bz2
troggle-951f88a59a9ed591b6ede995cf652c854bde5373.zip
allow extensions to be capatalised
Diffstat (limited to 'flatpages')
-rw-r--r--flatpages/views.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/flatpages/views.py b/flatpages/views.py
index cc1feef..0b4a8a0 100644
--- a/flatpages/views.py
+++ b/flatpages/views.py
@@ -78,20 +78,20 @@ def flatpage(request, path):
return HttpResponse(o.read(), mimetype=getmimetype(path))
def getmimetype(path):
- if path.endswith(".png"): return "image/png"
- if path.endswith(".tif"): return "image/tif"
- if path.endswith(".gif"): return "image/gif"
- if path.endswith(".jpeg"): return "image/jpeg"
- if path.endswith(".jpg"): return "image/jpeg"
- if path.endswith("svg"): return "image/svg+xml"
- if path.endswith(".pdf"): return "application/pdf"
- if path.endswith(".ps"): return "application/postscript"
- if path.endswith(".svx"): return "application/x-survex-svx"
- if path.endswith(".3d"): return "application/x-survex-3d"
- if path.endswith(".pos"): return "application/x-survex-pos"
- if path.endswith(".err"): return "application/x-survex-err"
- if path.endswith(".odt"): return "application/vnd.oasis.opendocument.text"
- if path.endswith(".ods"): return "application/vnd.oasis.opendocument.spreadsheet"
+ if path.lower().endswith(".png"): return "image/png"
+ if path.lower().endswith(".tif"): return "image/tif"
+ if path.lower().endswith(".gif"): return "image/gif"
+ if path.lower().endswith(".jpeg"): return "image/jpeg"
+ if path.lower().endswith(".jpg"): return "image/jpeg"
+ if path.lower().endswith("svg"): return "image/svg+xml"
+ if path.lower().endswith(".pdf"): return "application/pdf"
+ if path.lower().endswith(".ps"): return "application/postscript"
+ if path.lower().endswith(".svx"): return "application/x-survex-svx"
+ if path.lower().endswith(".3d"): return "application/x-survex-3d"
+ if path.lower().endswith(".pos"): return "application/x-survex-pos"
+ if path.lower().endswith(".err"): return "application/x-survex-err"
+ if path.lower().endswith(".odt"): return "application/vnd.oasis.opendocument.text"
+ if path.lower().endswith(".ods"): return "application/vnd.oasis.opendocument.spreadsheet"
return ""
@login_required_if_public