Skip to content

Commit

Permalink
src/main.js: fix isLocal && isHttp if condition
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeh committed Apr 13, 2024
1 parent bbb418f commit 400d829
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
/*
* force glitch to use https
*/
if (window.location.protocol === 'http:' && window.location.host !== 'localhost') {

const {
hostname,
protocol
} = window.location;
const isLocal = hostname !== 'localhost' && hostname !== '127.0.0.1';
const isHttp = protocol === 'http:';
if (!isLocal && isHttp) {
window.location.protocol = 'https:';
}
const main = async () => {
Expand Down

0 comments on commit 400d829

Please sign in to comment.