feat(link-meta): Tweaks getLinkMeta to whitelist trusted hostnames (#9139)
This commit is contained in:
@@ -62,7 +62,10 @@ export async function getLinkMeta(
|
|||||||
likelyType,
|
likelyType,
|
||||||
url,
|
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
|
return meta
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user