From 7c4ef5c1e93bc4cc4220daa40c96d06d3138388d Mon Sep 17 00:00:00 2001 From: Grant Echols Date: Thu, 14 Jan 2016 11:00:25 -0700 Subject: [PATCH 1/2] Broadened the check for mime type in the url to allow query strings --- src/legacytilesource.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/legacytilesource.js b/src/legacytilesource.js index 80891b43..73fc5e71 100644 --- a/src/legacytilesource.js +++ b/src/legacytilesource.js @@ -215,9 +215,9 @@ function filterFiles( files ){ if( file.height && file.width && file.url && ( - file.url.toLowerCase().match(/^.*\.(png|jpg|jpeg|gif)$/) || ( + file.url.toLowerCase().match(/^.*\.(png|jpg|jpeg|gif)(?:\?.*)?$/) || ( file.mimetype && - file.mimetype.toLowerCase().match(/^.*\/(png|jpg|jpeg|gif)$/) + file.mimetype.toLowerCase().match(/^.*\.(png|jpg|jpeg|gif)(?:\?.*)?$/) ) ) ){ //This is sufficient to serve as a level From 746f79e3f1c95ecb52ede06423345e96715aa0e4 Mon Sep 17 00:00:00 2001 From: Grant Echols Date: Fri, 15 Jan 2016 11:42:18 -0700 Subject: [PATCH 2/2] Restored the mime comparison regex - I was too agressive in my changes earlier. --- src/legacytilesource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/legacytilesource.js b/src/legacytilesource.js index 73fc5e71..b661b967 100644 --- a/src/legacytilesource.js +++ b/src/legacytilesource.js @@ -217,7 +217,7 @@ function filterFiles( files ){ file.url && ( file.url.toLowerCase().match(/^.*\.(png|jpg|jpeg|gif)(?:\?.*)?$/) || ( file.mimetype && - file.mimetype.toLowerCase().match(/^.*\.(png|jpg|jpeg|gif)(?:\?.*)?$/) + file.mimetype.toLowerCase().match(/^.*\/(png|jpg|jpeg|gif)$/) ) ) ){ //This is sufficient to serve as a level