import * as express from 'express' ; export const httpsRedirect = ( request , response , next ) => { if ( request . get ( 'x-forwarded-proto' ) === 'http' ) { const host = request . get ( 'host' ) ; const url = request . url ; response . redirect ( `https://${ host }${ url }` ) ; } else { next ( ) ; } } ;