This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { fetchWithTimeout } from "@/lib/helpers/fetchWithTimeout";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
@@ -15,7 +16,8 @@ export async function GET(request: NextRequest) {
|
||||
if (!["http:", "https:"].includes(parsed.protocol)) {
|
||||
return NextResponse.json({ error: "Invalid URL" }, { status: 400 });
|
||||
}
|
||||
const res = await fetch(url, {
|
||||
const res = await fetchWithTimeout(url, {
|
||||
timeoutMs: 5000,
|
||||
headers: { Accept: "image/svg+xml, text/xml, text/plain" },
|
||||
});
|
||||
if (!res.ok) {
|
||||
|
||||
Reference in New Issue
Block a user