We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b312273 commit 334b347Copy full SHA for 334b347
src/app/api/proxy/route.ts
@@ -39,8 +39,9 @@ export async function GET(req: NextRequest) {
39
async function downloadFile(params: { url: URL, maxBytes: number }): Promise<Blob> {
40
const { url, maxBytes } = params
41
const abortController = new AbortController()
42
+ const timeoutSignal = AbortSignal.timeout(30 * 1000)
43
const response = await fetch(url, {
- signal: AbortSignal.any([abortController.signal])
44
+ signal: AbortSignal.any([abortController.signal, timeoutSignal])
45
})
46
if (!response.body) {
47
throw new Error("Response body unavailable")
0 commit comments