Skip to content

Commit

Permalink
Add check for localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Morgan committed Jul 30, 2019
1 parent 6c9748a commit d68a2f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d68a2f4

Please sign in to comment.