Selaa lähdekoodia

Fix support for relative URLs

Garrett Johnson 3 vuotta sitten
vanhempi
commit
185014ab57
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      src/base/TilesRendererBase.js

+ 2 - 1
src/base/TilesRendererBase.js

@@ -339,7 +339,8 @@ export class TilesRendererBase {
 				);
 
 				// remove trailing slash and last path-segment from the URL
-				const basePath = url.replace( /\/[^\/]*\/?$/, '' );
+				let basePath = url.replace( /\/[^\/]*\/?$/, '' );
+				basePath = new URL( basePath, window.location.href ).toString();
 
 				traverseSet(
 					json.root,