diff --git a/lib/isUrlRequest.js b/lib/isUrlRequest.js index ed5789b..8e7831d 100644 --- a/lib/isUrlRequest.js +++ b/lib/isUrlRequest.js @@ -5,7 +5,7 @@ function isUrlRequest(url, root) { // 1. it's a Data Url // 2. it's an absolute url or and protocol-relative // 3. it's some kind of url for a template - if(/^data:|^.+-extension:\/|^(https?:)?\/\/|^[\{\}\[\]#*;,'§\$%&\(=?`´\^°<>]/.test(url)) { + if(/^data:|^.+-extension:\/|^about:blank$|^(https?:)?\/\/|^[\{\}\[\]#*;,'§\$%&\(=?`´\^°<>]/.test(url)) { return false; } diff --git a/test/isUrlRequest.test.js b/test/isUrlRequest.test.js index bab4e0e..80c4da4 100644 --- a/test/isUrlRequest.test.js +++ b/test/isUrlRequest.test.js @@ -51,7 +51,10 @@ describe("isUrlRequest()", () => { [["/path/to/thing", 1], new ExpectedError(/unexpected parameters/i), "should throw an error on invalid root"], // empty url - [[""], true, "should be positive if url is empty"] + [[""], true, "should be positive if url is empty"], + + // about url + [["about:blank"], false, "should be negative for about:blank"] ].forEach((test) => { it(test[2], () => { const expected = test[1];