From d68a2f4acf03c1d771dd8070671085d938b98d52 Mon Sep 17 00:00:00 2001 From: Blake Morgan Date: Tue, 30 Jul 2019 13:38:00 -0600 Subject: [PATCH] Add check for localhost --- dist/bundle.js | 2 +- package-lock.json | 2 +- src/entry.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/bundle.js b/dist/bundle.js index 15c6b6a..74d0701 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -197,7 +197,7 @@ function load(bundleUrl, polyfillRootUrl) { function loadScript(relativeUrl) { const url = new URL(relativeUrl, myUrl); const el = document.createElement("script"); - if (url.protocol !== 'https:') { + if (url.protocol !== 'https:' && url.hostname !== 'localhost') { url.protocol = 'https:'; } el.src = url.href; diff --git a/package-lock.json b/package-lock.json index 801de5f..fec7679 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@byuweb/web-components-loader", - "version": "0.2.1", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/entry.js b/src/entry.js index 57416d9..8701c14 100644 --- a/src/entry.js +++ b/src/entry.js @@ -19,7 +19,7 @@ export default function load(bundleUrl, polyfillRootUrl) { function loadScript(relativeUrl) { const url = new URL(relativeUrl, myUrl); const el = document.createElement("script"); - if (url.protocol !== 'https:') { + if (url.protocol !== 'https:' && url.hostname !== 'localhost') { url.protocol = 'https:' } el.src = url.href;