diff options
author | Martin <devnull@localhost> | 2012-08-14 15:05:15 +0200 |
---|---|---|
committer | Martin <devnull@localhost> | 2012-08-14 15:05:15 +0200 |
commit | 8dd51096cff97bd66a2999daac7e4de108f3ec45 (patch) | |
tree | ac08c0ee8377ea295fdced94e1ce07e5a75eead2 | |
parent | ecd5bbcb1dbb00cc0d39cdf80151f41c07c6c8b2 (diff) | |
download | troggle-8dd51096cff97bd66a2999daac7e4de108f3ec45.tar.gz troggle-8dd51096cff97bd66a2999daac7e4de108f3ec45.tar.bz2 troggle-8dd51096cff97bd66a2999daac7e4de108f3ec45.zip |
allow extensions to be capatalised
-rw-r--r-- | flatpages/views.py | 28 |
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 |