Last active
December 22, 2016 15:37
-
-
Save godrix/32f01734bd300f10f82ed59db593921a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Forçando navagador a usar o https | |
console.log(window.location.href); | |
var protocol = window.location.href; | |
if (protocol.match(/http:/)){ | |
var newUrl = protocol.replace("http://","https://"); | |
window.location = newUrl; | |
}else{ | |
console.log('Protocolo seguro'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment