Skip to content

Commit

Permalink
fix: use native Response.redirect for file redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
Vexcited committed Aug 11, 2023
1 parent 0a5b01f commit a325b39
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/routes/api/file/[upload_id].ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type APIEvent, json, redirect } from "solid-start"
import { type APIEvent, json } from "solid-start";

import { supabase, getUserProfile } from "@/supabase/server";
import { UploadedFile, UserProfile } from "@/types/api";

Expand Down Expand Up @@ -61,7 +62,7 @@ export const GET = async ({ request, params }: APIEvent): Promise<Response> => {
.from("uploads")
.createSignedUrl(`${file_data.creator ?? "anon"}/${file_data.id}.${file_extension}`, 3600);

return redirect(data!.signedUrl);
return Response.redirect(data!.signedUrl, 301);
}
catch (error) {
console.error(error);
Expand Down

0 comments on commit a325b39

Please sign in to comment.