Tuesday, April 4, 2017

Force use of HTTPS with Javascript

<script>
location.protocol=='https:' ? console.log(window.location.href) : replace('https:'+location.hostname+location.pathname);
</script>