Initial Commit
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
export function proxyImage(url: string | null | undefined): string | undefined {
|
||||
if (!url) return undefined;
|
||||
// Already a local path (e.g. cached media) — load it directly. The proxy
|
||||
// only knows how to handle Instagram's own CDN hosts, and a relative
|
||||
// path has no host at all, so it would otherwise get rejected.
|
||||
if (url.startsWith('/')) return url;
|
||||
return `/image-proxy?url=${encodeURIComponent(url)}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user