|
@@ -3,7 +3,9 @@ import config from '@config';
|
|
|
export default () => {
|
|
|
return async (ctx: Context, next: Next): Promise<void> => {
|
|
|
const host: string = ctx.host;
|
|
|
- const isMatch = config.checkHost.find(el => host.match(el));
|
|
|
+ const domain = host.replace(/(:[^:]+)$/, '');
|
|
|
+ const isMatch = config.checkHost.find(el => domain.match(el));
|
|
|
+ console.log(host, config.checkHost, isMatch);
|
|
|
if (!isMatch) {
|
|
|
// 域名不对
|
|
|
ctx.status = 403;
|