feat(link-meta): Tweaks getLinkMeta to whitelist trusted hostnames (#9139)

This commit is contained in:
Eduardo Rosendo
2025-10-06 09:36:33 -04:00
committed by GitHub
parent 0c0c21a0aa
commit 42a427cfd6
+4 -1
View File
@@ -62,7 +62,10 @@ export async function getLinkMeta(
likelyType,
url,
}
if (likelyType !== LikelyType.HTML) {
const htmlExemptedHostnames: string[] = ['storage.courtlistener.com']
const isExemptedFromHtmlCheck = htmlExemptedHostnames.includes(urlp.hostname)
// Skip early return only for hosts exempted from the HTML check
if (likelyType !== LikelyType.HTML && !isExemptedFromHtmlCheck) {
return meta
}