Add function to check if profile host is allowed

This commit is contained in:
2026-01-07 23:26:55 +01:00
parent 113fdc6816
commit acbaa6cfcb

View File

@@ -166,6 +166,16 @@ function extractIgMeta(raw: any): EntryRecord['igMeta'] {
};
}
function isAllowedProfileHost(urlString: string) {
try {
const { hostname } = new URL(urlString);
const safeHosts = ['instagram.com', 'cdninstagram.com', 'fbcdn.net'];
return safeHosts.some((h) => hostname.endsWith(h) || hostname.includes(`.${h}`));
} catch {
return false;
}
}
async function loadEntries() {
entryIndex.clear();