mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
DziTileSource: avoid changing relative paths
For cases where DZI files aren't explicitly configured with a tilesUrl, the logic for generating a URL from the DZI source URL would inject an extra leading `/` which would either cause an unnecessary redirect or break depending on whether the webserver in use attempts to normalize `//` to `/`. This change also removes some URL processing logic which duplicates the browser's default behaviour
This commit is contained in:
parent
122369eb5e
commit
2345f9b217
@ -108,19 +108,8 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
|
|||||||
options = configureFromObject( this, data );
|
options = configureFromObject( this, data );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( url && !options.tilesUrl ){
|
if (url && !options.tilesUrl) {
|
||||||
if( 'http' !== url.substring( 0, 4 ) ){
|
options.tilesUrl = url.replace(/([^\/]+)\.dzi$/, '$1_files/');
|
||||||
host = location.protocol + '//' + location.host;
|
|
||||||
}
|
|
||||||
dziPath = url.split('/');
|
|
||||||
dziName = dziPath.pop();
|
|
||||||
dziName = dziName.substring(0, dziName.lastIndexOf('.'));
|
|
||||||
dziPath = '/' + dziPath.join('/') + '/' + dziName + '_files/';
|
|
||||||
tilesUrl = dziPath;
|
|
||||||
if( host ){
|
|
||||||
tilesUrl = host + tilesUrl;
|
|
||||||
}
|
|
||||||
options.tilesUrl = tilesUrl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
|
Loading…
Reference in New Issue
Block a user