From fbdc28b2e68ac52eb194ceda04572218c9c9d582 Mon Sep 17 00:00:00 2001 From: octavm Date: Tue, 24 Apr 2018 14:45:57 +0200 Subject: [PATCH 1/2] Prevent token repeating in url Fix for #1090 --- src/Layers/BasemapLayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Layers/BasemapLayer.js b/src/Layers/BasemapLayer.js index 76be926de..96eee9542 100644 --- a/src/Layers/BasemapLayer.js +++ b/src/Layers/BasemapLayer.js @@ -204,7 +204,7 @@ export var BasemapLayer = TileLayer.extend({ Util.setOptions(this, tileOptions); - if (this.options.token) { + if (this.options.token && !config.urlTemplate.includes('token=')) { config.urlTemplate += ('?token=' + this.options.token); } From 72b2760049c73700848f16b2d2e024bfdbcff42c Mon Sep 17 00:00:00 2001 From: octavm Date: Tue, 24 Apr 2018 21:23:06 +0200 Subject: [PATCH 2/2] Prevent token repeating in url Fix for #1090 --- src/Layers/BasemapLayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Layers/BasemapLayer.js b/src/Layers/BasemapLayer.js index 96eee9542..1f4fb399f 100644 --- a/src/Layers/BasemapLayer.js +++ b/src/Layers/BasemapLayer.js @@ -204,7 +204,7 @@ export var BasemapLayer = TileLayer.extend({ Util.setOptions(this, tileOptions); - if (this.options.token && !config.urlTemplate.includes('token=')) { + if (this.options.token && config.urlTemplate.indexOf('token=') === -1) { config.urlTemplate += ('?token=' + this.options.token); }