Skip to content

Commit

Permalink
feat: use 308 redirect for post requests
Browse files Browse the repository at this point in the history
  • Loading branch information
kane50613 committed Dec 3, 2024
1 parent c7b4372 commit d053077
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/routes/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ export async function handleApiRequest(request: Request, url: URL) {
request.headers.set("Host", "discord.com");

if (request.method !== "GET" && request.method !== "HEAD") {
return fetch(url, {
...request,
signal: AbortSignal.timeout(10_000),
});
return Response.redirect(url.toString(), 308);
}

const cacheKey = createCacheKey(request);
Expand Down

0 comments on commit d053077

Please sign in to comment.