gpx mime type

merge-requests/30/head
Bob Mottram 2022-08-23 11:49:58 +01:00
parent 2e0b5e9f9a
commit de2da71381
1 changed files with 9 additions and 5 deletions

View File

@ -17093,13 +17093,17 @@ class PubServer(BaseHTTPRequestHandler):
# hashtag map kml # hashtag map kml
if self.path.startswith('/tagmaps/') or \ if self.path.startswith('/tagmaps/') or \
(authorized and '/tagmaps/' in self.path): (authorized and '/tagmaps/' in self.path):
kml_str = kml_from_tagmaps_path(self.server.base_dir, self.path, map_str = kml_from_tagmaps_path(self.server.base_dir, self.path,
self.server.map_format) self.server.map_format)
if kml_str: if map_str:
msg = kml_str.encode('utf-8') msg = map_str.encode('utf-8')
msglen = len(msg) msglen = len(msg)
header_type = \ if self.server.map_format == 'gpx':
'application/vnd.google-earth.kml+xml; charset=utf-8' header_type = \
'application/gpx+xml; charset=utf-8'
else:
header_type = \
'application/vnd.google-earth.kml+xml; charset=utf-8'
self._set_headers(header_type, msglen, self._set_headers(header_type, msglen,
None, calling_domain, True) None, calling_domain, True)
self._write(msg) self._write(msg)