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.
This commit is contained in:
Marcus Jaschen 2024-10-14 09:39:12 +02:00 committed by Gautier P
parent 6b24a8790e
commit babd154596

View file

@ -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');