From 2cf5f8ebe25d6bc4deff9a1b49a63221bf7fb82a Mon Sep 17 00:00:00 2001 From: Allain Lalonde Date: Thu, 4 Apr 2019 13:47:42 -0400 Subject: [PATCH] scheme should not match unless at the beginning of url SCHEME_REGEX.test("testing123/blahblah/dat://test") should not match the regex --- chrome extension/datparse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome extension/datparse.js b/chrome extension/datparse.js index 9a65665..e5b7206 100644 --- a/chrome extension/datparse.js +++ b/chrome extension/datparse.js @@ -1,7 +1,7 @@ const isNode = typeof window === 'undefined' const parse = isNode ? require('url').parse : browserParse -const SCHEME_REGEX = /[a-z]+:\/\//i +const SCHEME_REGEX = /^[a-z]+:\/\//i // 1 2 3 4 const VERSION_REGEX = /^(dat:\/\/)?([^/]+)(\+[^/]+)(.*)$/i