Browse Source

fixed issue when trying to resolve (invalid) empty URL

Gildas 7 years ago
parent
commit
1d78f84b7e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib/single-file/single-file-core.js

+ 2 - 1
lib/single-file/single-file-core.js

@@ -1175,6 +1175,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 	const DATA_URI_PREFIX = "data:";
 	const BLOB_URI_PREFIX = "blob:";
 	const HTTP_URI_PREFIX = /^https?:\/\//;
+	const EMPTY_URL = /^https?:\/\/+.*$/;
 	const ABOUT_BLANK_URI = "about:blank";
 	const NOT_EMPTY_URL = /^https?:\/\/.+/;
 	const REGEXP_URL_FN = /(url\s*\(\s*'(.*?)'\s*\))|(url\s*\(\s*"(.*?)"\s*\))|(url\s*\(\s*(.*?)\s*\))/gi;
@@ -1253,7 +1254,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		}
 
 		static testValidPath(resourceURL, baseURI) {
-			return resourceURL && resourceURL != baseURI;
+			return resourceURL && resourceURL != baseURI && !resourceURL.match(EMPTY_URL);
 		}
 
 		static testValidURL(resourceURL, baseURI) {