Skip to content

Instantly share code, notes, and snippets.

@godrix
Last active December 22, 2016 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save godrix/32f01734bd300f10f82ed59db593921a to your computer and use it in GitHub Desktop.
Save godrix/32f01734bd300f10f82ed59db593921a to your computer and use it in GitHub Desktop.
//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