ImageZoom: load attachments from cdn instead of media proxy

This commit is contained in:
Vendicated 2025-12-17 22:56:59 +01:00
parent 16f343be52
commit 74f106c9fc
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -162,6 +162,9 @@ export const Magnifier = ErrorBoundary.wrap<MagnifierProps>(({ instance, size: i
const imageSrc = useMemo(() => {
try {
const imageUrl = new URL(instance.props.src);
if (imageUrl.pathname.startsWith("/attachments/"))
imageUrl.hostname = "cdn.discordapp.com";
imageUrl.searchParams.set("animated", "true");
return imageUrl.toString();
} catch {