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