in expressjs, can
app.use(function(req, res, next) { if((!req.secure) && (req.get('x-forwarded-proto') !== 'https')) { res.redirect('https://' + req.get('host') + req.url); console.log('redirected http request https'); } else { next(); } }); to redirect http request https.
how do in readstone?
i tried following, not work.
@app.route('/') adlmain() { if (app.request.requesteduri.scheme != 'https') { var httpsurl = app.request.requesteduri.replace(scheme: 'https').tostring(); app.redirect(httpsurl); } return new file('build/web/index.html'); }
Comments
Post a Comment