summaryrefslogtreecommitdiffstats
path: root/core/views/expo.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2024-07-08 11:59:10 +0200
committerPhilip Sargent <philip.sargent@gmail.com>2024-07-08 11:59:10 +0200
commitcb854696c93ed4bd2fdaf76d78857a240c10b52f (patch)
treea57ae6fc21180885c47527658d4b26ef72abc91a /core/views/expo.py
parent5ffe8230b1a149cbedbfbe098ad7b1e3e07a528b (diff)
downloadtroggle-cb854696c93ed4bd2fdaf76d78857a240c10b52f.tar.gz
troggle-cb854696c93ed4bd2fdaf76d78857a240c10b52f.tar.bz2
troggle-cb854696c93ed4bd2fdaf76d78857a240c10b52f.zip
content type for gpx and kml
Diffstat (limited to 'core/views/expo.py')
-rw-r--r--core/views/expo.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/views/expo.py b/core/views/expo.py
index 6ce9cb7..3e75e5e 100644
--- a/core/views/expo.py
+++ b/core/views/expo.py
@@ -305,8 +305,16 @@ def getmimetype(path):
"""Our own version rather than relying on what is provided by the python library. Note that when
Apache or nginx is used to deliver /expofiles/ it will use it's own idea of mimetypes and
not these.
+
+ This sets the Content Type in the HTTP header, e.g.
+ Content-Type: text/html; charset=utf-8
"""
path = str(path)
+
+ if path.lower().endswith("gpx"):
+ return "application/octet-stream"
+ if path.lower().endswith("kml"):
+ return "application/octet-stream"
if path.lower().endswith(".css"):
return "text/css"
if path.lower().endswith(".txt"):