commit 77b911ea1f8a21efc8de231644392c03ca5fb942
parent 0072db13bd54d1efdb3e2c54372c9cc6ca7ee093
Author: myadzel <myadzel@gmail.com>
Date: Thu, 12 Dec 2019 17:46:12 +0300
fix track parsing from tracedetrail #279
Ignore "/index.php" in the middle of the url.
This fragment is added when redirection from http to https occurs.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lib/leaflet.control.track-list/lib/services/tracedetrail.js b/src/lib/leaflet.control.track-list/lib/services/tracedetrail.js
@@ -3,7 +3,7 @@ import urlViaCorsProxy from '~/lib/CORSProxy';
import L from 'leaflet';
class Tracedetrail extends BaseService {
- urlRe = /^https?:\/\/tracedetrail\.[a-z]{2,}\/[a-z]{2}\/trace\/trace\/([0-9]+)/;
+ urlRe = /^https?:\/\/tracedetrail\.[a-z]{2,}(\/index\.php)?\/[a-z]{2}\/trace\/trace\/([0-9]+)/;
isOurUrl() {
return this.urlRe.test(this.origUrl);
@@ -11,7 +11,7 @@ class Tracedetrail extends BaseService {
requestOptions() {
const m = this.urlRe.exec(this.origUrl);
- const trackId = this.trackId = m[1];
+ const trackId = this.trackId = m[2];
return [{
url: urlViaCorsProxy(`https://tracedetrail.com/en/trace/geomSections/${trackId}`),