From babd154596f541acad9d7657ba764a6190b5ae21 Mon Sep 17 00:00:00 2001 From: Marcus Jaschen Date: Mon, 14 Oct 2024 09:39:12 +0200 Subject: [PATCH] allow additional GeoJSON MIME type The MIME type for GeoJSON registered with IANA is application/geo+json`, replacing the old value `application/vnd.geo+json`. The change was published with RFC 7946 in 2016. BRouter reponses changed to `application/geo+json` in recent versions. With this commit BRouter-Web accepts either of both MIME type strings in BRouter responses. --- js/router/BRouter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/router/BRouter.js b/js/router/BRouter.js index ccdf2be..d1bc9e6 100644 --- a/js/router/BRouter.js +++ b/js/router/BRouter.js @@ -171,7 +171,8 @@ L.BRouter = L.Class.extend({ xhr.status === 200 && xhr.responseText && // application error when not GeoJSON format (text/plain for errors) - xhr.getResponseHeader('Content-Type').split(';')[0] === 'application/vnd.geo+json' + (xhr.getResponseHeader('Content-Type').split(';')[0] === 'application/geo+json' || + xhr.getResponseHeader('Content-Type').split(';')[0] === 'application/vnd.geo+json') ) { // leaflet.spin //gpxLayer.fire('data:loaded');