nakarte

Source code of https://map.sikmir.ru (fork)
git clone git://git.sikmir.ru/nakarte
Log | Files | Refs | LICENSE

commit adf8478a2f74fd11997ac715509ee35a340179f0
parent a6c2b64a4049d17092d10f29db1e28ebdc5eee53
Author: Sergey Orlov <wladimirych@gmail.com>
Date:   Wed,  6 May 2020 21:33:49 +0200

send uid cookie for tracks server and elevation server

Diffstat:
Msrc/lib/leaflet.control.elevation-profile/index.js | 2+-
Msrc/lib/leaflet.control.track-list/lib/services/nakarte/index.js | 2+-
Msrc/lib/leaflet.control.track-list/track-list.js | 6+++++-
3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/lib/leaflet.control.elevation-profile/index.js b/src/lib/leaflet.control.elevation-profile/index.js @@ -975,7 +975,7 @@ const ElevationProfile = L.Class.extend({ req.push(latlngs[i].lat.toFixed(6) + ' ' + latlngs[i].lng.toFixed(6)); } req = req.join('\n'); - const xhrPromise = fetch(this.options.elevationsServer, {method: 'POST', data: req}); + const xhrPromise = fetch(this.options.elevationsServer, {method: 'POST', data: req, withCredentials: true}); this.abortLoading = xhrPromise.abort.bind(xhrPromise); return xhrPromise.then( function(xhr) { diff --git a/src/lib/leaflet.control.track-list/lib/services/nakarte/index.js b/src/lib/leaflet.control.track-list/lib/services/nakarte/index.js @@ -69,7 +69,7 @@ class NakarteUrlLoader { const requests = values.map((trackId) => fetch( `${config.tracksStorageServer}/track/${trackId}`, - {responseType: 'binarystring'} + {responseType: 'binarystring', withCredentials: true} ) ); let responses; diff --git a/src/lib/leaflet.control.track-list/track-list.js b/src/lib/leaflet.control.track-list/track-list.js @@ -510,7 +510,11 @@ L.Control.TrackList = L.Control.extend({ const key = btoa(hashDigest).replace(/\//ug, '_').replace(/\+/ug, '-').replace(/=/ug, ''); const url = window.location + '&nktl=' + key; copyToClipboard(url, mouseEvent); - fetch(`${config.tracksStorageServer}/track/${key}`, {method: 'POST', data: serialized}).then( + fetch(`${config.tracksStorageServer}/track/${key}`, { + method: 'POST', + data: serialized, + withCredentials: true + }).then( null, (e) => { let message = e.message || e; if (e.xhr.status === 413) {