From cb854696c93ed4bd2fdaf76d78857a240c10b52f Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Mon, 8 Jul 2024 11:59:10 +0200 Subject: [PATCH] content type for gpx and kml --- core/views/expo.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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"):