Subdomain redirecting
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user