mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-18 13:22:03 +00:00
Catch the domains the right way
This commit is contained in:
@@ -41,7 +41,7 @@ async function query(domainId: string, domain: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let existing: any[] = [];
|
let existing: any[] = [];
|
||||||
if (domainRecord.type == "ns" || domainRecord.type == "wildcard") { // the manual "wildcard" domains can have wildcard certs
|
if (domainRecord.type == "ns" || domainRecord.type == "wildcard") {
|
||||||
const domainLevelDown = domain.split(".").slice(1).join(".");
|
const domainLevelDown = domain.split(".").slice(1).join(".");
|
||||||
const wildcardPrefixed = `*.${domainLevelDown}`;
|
const wildcardPrefixed = `*.${domainLevelDown}`;
|
||||||
|
|
||||||
@@ -64,8 +64,13 @@ async function query(domainId: string, domain: string) {
|
|||||||
eq(certificates.domainId, domainId),
|
eq(certificates.domainId, domainId),
|
||||||
or(
|
or(
|
||||||
eq(certificates.domain, domain),
|
eq(certificates.domain, domain),
|
||||||
eq(certificates.domain, domainLevelDown),
|
and(
|
||||||
eq(certificates.domain, wildcardPrefixed)
|
eq(certificates.wildcard, true),
|
||||||
|
or(
|
||||||
|
eq(certificates.domain, domainLevelDown),
|
||||||
|
eq(certificates.domain, wildcardPrefixed)
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user