Skip to content

Full Toolkit for Next-Level Domain Analysis

Fix certs list containing unintended results 🙈

Felix Wotschofskycd2293b7f416
diff --git a/lib/certs.ts b/lib/certs.ts
index 772eea8..beb6532 100644
--- a/lib/certs.ts
+++ b/lib/certs.ts
@@ -23,7 +23,13 @@ export const lookupCerts = async (domain: string): Promise<CertsData> => {
throw new Error('Failed to fetch certs');
}
- return await response.json();
+ const data: CertsData = await response.json();
+
+ return data.filter((cert) =>
+ cert.name_value
+ .split(/\n/g)
+ .some((value) => value === domain || value.endsWith(`.${domain}`))
+ );
};
export const lookupRelatedCerts = async (domain: string) => {