server: block subdomains of a blocked host #259
1 changed files with 2 additions and 2 deletions
|
@ -29,10 +29,10 @@ export async function shouldBlockInstance(host: Instance['host']): Promise<boole
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const result: { exists: boolean } = await db.query('SELECT EXISTS(SELECT "host" FROM instance WHERE ("host" = $1 OR "host" LIKE \'%.\' || $1) AND "isSuspended") AS "exists"', [
|
const result = await db.query('SELECT "host" FROM instance WHERE ("host" = $1 OR "host" LIKE \'%.\' || $1) AND "isSuspended"', [
|
||||||
host,
|
host,
|
||||||
]);
|
]);
|
||||||
return result.exists;
|
return result.host.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue