fix: 🐛 double-slash in proxy url
This commit is contained in:
parent
33b4b1d18c
commit
2448b2ce99
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user