From 870bb2a99a815c214c07d7c16cbaaef9ee1dc5d6 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Mon, 7 Nov 2016 11:42:37 +0300 Subject: [PATCH 1/2] See #832, further fix for dzitilesource guessing of tilesUrl, for iiipserver configurations like /iiipsrv?DeepZoom=/path/my.dzi --- src/dzitilesource.js | 2 +- test/modules/dzitilesource.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dzitilesource.js b/src/dzitilesource.js index 5d00980f..017594ca 100644 --- a/src/dzitilesource.js +++ b/src/dzitilesource.js @@ -140,7 +140,7 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, /** @lends OpenSead if (url && !options.tilesUrl) { options.tilesUrl = url.replace( - /([^\/]+?)(\.(dzi|xml|js))?\/?(\?.*)?$/, '$1_files/'); + /([^\/]+?)(\.(dzi|xml|js))?(\?[^\/]*)?\/?$/, '$1_files/'); if (url.search(/\.(dzi|xml|js)\?/) != -1) { options.queryParams = url.match(/\?.*/); diff --git a/test/modules/dzitilesource.js b/test/modules/dzitilesource.js index fe4677a0..395efaea 100644 --- a/test/modules/dzitilesource.js +++ b/test/modules/dzitilesource.js @@ -32,7 +32,10 @@ 'relative link should stay the same'); testImplicitTilesUrl( '/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'); }); }()); From 63e4daab5042708c7095c855a5d833bdec2f1528 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Tue, 8 Nov 2016 02:02:59 +0300 Subject: [PATCH 2/2] fixed type im test case --- test/modules/dzitilesource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/modules/dzitilesource.js b/test/modules/dzitilesource.js index 395efaea..e7eb2114 100644 --- a/test/modules/dzitilesource.js +++ b/test/modules/dzitilesource.js @@ -34,7 +34,7 @@ '/p/foo.dzi?a=1&b=2', '/p/foo_files/', 'querystring in dzi url should be ignored after slashes'); testImplicitTilesUrl( - '/iiipsrv?DeepZoom=/path/my.dzi', '/iiipsrv?DeepZoom=/path/mine_files/', + '/iiipsrv?DeepZoom=/path/my.dzi', '/iiipsrv?DeepZoom=/path/my_files/', 'querystring in dzi url should not be ignored before slashes'); });