Skip to content

Commit

Permalink
allow additional GeoJSON MIME type
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mjaschen authored and bagage committed Oct 14, 2024
1 parent 6b24a87 commit babd154
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/router/BRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit babd154

Please sign in to comment.