https-scheme
redirects window location to HTTPS scheme
Usage
Just add this line of code in your JavaScript client code.
Or, if you prefer maybe cause you want to call it if some condition is met, for instance only in production
const forceHttps = if isProduction
Annotated source
Check if protocol is https. If yes, redirect location to homonym secure URL.
{ if windowlocationprotocol !== 'https:' windowlocationhref = 'https:' + windowlocationhref } moduleexports = exportsdefault = forceHttps