Debugging for heroku

This commit is contained in:
Jori Lallo
2016-05-27 00:00:00 -07:00
parent a0e2092e01
commit eab41436a6
2 changed files with 14 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
export default function subdomainRedirect(options) {
return async function subdomainRedirectMiddleware(ctx, next) {
console.log(ctx.headers);
if (ctx.headers['x-forwarded-proto'] != 'https') {
ctx.redirect('https://' + ctx.headers.host + ctx.path);
}
else {
return next();
}
}
};