From 91fd9ec49686148698a5f7577644e1310ff41168 Mon Sep 17 00:00:00 2001 From: mgermerie <73115044+mgermerie@users.noreply.github.com> Date: Mon, 22 Aug 2022 11:29:22 +0200 Subject: [PATCH] fix(Scheduler): replace url subdomains alternatives --- src/Core/Scheduler/Scheduler.js | 4 +++- src/Provider/URLBuilder.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Core/Scheduler/Scheduler.js b/src/Core/Scheduler/Scheduler.js index 040194caaf..fac08967fe 100644 --- a/src/Core/Scheduler/Scheduler.js +++ b/src/Core/Scheduler/Scheduler.js @@ -9,6 +9,7 @@ import DataSourceProvider from 'Provider/DataSourceProvider'; import TileProvider from 'Provider/TileProvider'; import $3dTilesProvider from 'Provider/3dTilesProvider'; import PointCloudProvider from 'Provider/PointCloudProvider'; +import URLBuilder from 'Provider/URLBuilder'; import CancelledCommandException from './CancelledCommandException'; function queueOrdering(a, b) { @@ -153,7 +154,8 @@ Scheduler.prototype.execute = function execute(command) { // parse host const layer = command.layer; - const host = layer.source && layer.source.url ? new URL(layer.source.url, document.location).host : undefined; + const host = layer.source && layer.source.url ? + new URL(URLBuilder.subDomains(layer.source.url), document.location).host : undefined; command.promise = new Promise((resolve, reject) => { command.resolve = resolve; diff --git a/src/Provider/URLBuilder.js b/src/Provider/URLBuilder.js index de9866d779..6dbec3bc77 100644 --- a/src/Provider/URLBuilder.js +++ b/src/Provider/URLBuilder.js @@ -28,6 +28,8 @@ function subDomains(url) { * @module URLBuilder */ export default { + subDomains, + /** * Builds an URL knowing the coordinates and the source to query. *