Subdomain redirecting

This commit is contained in:
Jori Lallo
2016-05-27 00:06:36 -07:00
parent eab41436a6
commit a0f86f5ed4
3 changed files with 6 additions and 4 deletions

View File

@@ -1,12 +0,0 @@
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();
}
}
};