Skip to content

Instantly share code, notes, and snippets.

@Nukeer
Last active October 3, 2019 19:25
Show Gist options
  • Save Nukeer/d4d0580878008527527578d7c7b712ad to your computer and use it in GitHub Desktop.
Save Nukeer/d4d0580878008527527578d7c7b712ad to your computer and use it in GitHub Desktop.
Redirect http to https
import { environment } from 'src/environments/environment';
if (environment.production) {
if (location.protocol === 'http:') {
location.href = location.href.replace('http', 'https');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment