File tree 1 file changed +5
-8
lines changed
1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,8 @@ export async function handleApiRequest(request: Request, url: URL) {
15
15
request . headers . set ( "Host" , "discord.com" ) ;
16
16
17
17
if ( request . method !== "GET" && request . method !== "HEAD" ) {
18
- return fetch ( url . toString ( ) , {
19
- method : request . method ,
20
- headers : request . headers ,
21
- body : request . body ,
18
+ return fetch ( url , {
19
+ ...request ,
22
20
signal : AbortSignal . timeout ( 10_000 ) ,
23
21
} ) ;
24
22
}
@@ -47,10 +45,9 @@ export async function handleApiRequest(request: Request, url: URL) {
47
45
}
48
46
49
47
async function makeRequest ( cacheKey : bigint , url : URL , request : Request ) {
50
- const response = await fetch ( url . toString ( ) , {
51
- method : request . method ,
52
- headers : request . headers ,
53
- body : request . body ,
48
+ const response = await fetch ( url , {
49
+ ...request ,
50
+ signal : AbortSignal . timeout ( 10_000 ) ,
54
51
} ) ;
55
52
56
53
const content =
You can’t perform that action at this time.
0 commit comments