From c510d83ea2ccf88e2b243199ecf3cad3c8c9eee8 Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Sun, 19 Mar 2023 04:29:37 +0000 Subject: [PATCH] Use special scheme `https` when resolving URLs Fixes #8 --- epub.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epub.js b/epub.js index 15e71fa..7df3613 100644 --- a/epub.js +++ b/epub.js @@ -59,7 +59,7 @@ const resolveURL = (url, relativeTo) => { try { if (relativeTo.includes(':')) return new URL(url, relativeTo) // the base needs to be a valid URL, so set a base URL and then remove it - const root = 'whatever:///' + const root = 'https://invalid.invalid/' return decodeURI(new URL(url, root + relativeTo).href.replace(root, '')) } catch(e) { console.warn(e)