diff --git a/packages/backend/src/server/proxy/proxy-media.ts b/packages/backend/src/server/proxy/proxy-media.ts index b3bb03124..ed607daa0 100644 --- a/packages/backend/src/server/proxy/proxy-media.ts +++ b/packages/backend/src/server/proxy/proxy-media.ts @@ -14,13 +14,15 @@ import { serverLogger } from "../index.js"; import { isMimeImage } from "@/misc/is-mime-image.js"; export async function proxyMedia(ctx: Koa.Context) { - const url = "url" in ctx.query ? ctx.query.url : `https://${ctx.params.url}`; + let url = "url" in ctx.query ? ctx.query.url : `https://${ctx.params.url}`; if (typeof url !== "string") { ctx.status = 400; return; } + url = url.replace("//", "/"); + const { hostname } = new URL(url); let resolvedIps; try {