See #832, further fix for dzitilesource guessing of tilesUrl, for iiipserver configurations like /iiipsrv?DeepZoom=/path/my.dzi

This commit is contained in:
Alexey Tikhonov 2016-11-07 11:42:37 +03:00
parent b9df7f3cde
commit 870bb2a99a
2 changed files with 5 additions and 2 deletions

View File

@ -140,7 +140,7 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, /** @lends OpenSead
if (url && !options.tilesUrl) { if (url && !options.tilesUrl) {
options.tilesUrl = url.replace( options.tilesUrl = url.replace(
/([^\/]+?)(\.(dzi|xml|js))?\/?(\?.*)?$/, '$1_files/'); /([^\/]+?)(\.(dzi|xml|js))?(\?[^\/]*)?\/?$/, '$1_files/');
if (url.search(/\.(dzi|xml|js)\?/) != -1) { if (url.search(/\.(dzi|xml|js)\?/) != -1) {
options.queryParams = url.match(/\?.*/); options.queryParams = url.match(/\?.*/);

View File

@ -32,7 +32,10 @@
'relative link should stay the same'); 'relative link should stay the same');
testImplicitTilesUrl( testImplicitTilesUrl(
'/p/foo.dzi?a=1&b=2', '/p/foo_files/', '/p/foo.dzi?a=1&b=2', '/p/foo_files/',
'querystring in dzi url should be ignored'); 'querystring in dzi url should be ignored after slashes');
testImplicitTilesUrl(
'/iiipsrv?DeepZoom=/path/my.dzi', '/iiipsrv?DeepZoom=/path/mine_files/',
'querystring in dzi url should not be ignored before slashes');
}); });
}()); }());