Skip to content

Commit fad78c4

Browse files
committed
Do a very basic user agent header check before showing release channels.
1 parent 0fb75a6 commit fad78c4

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/pages/api/release-channels.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
export async function GET() {
1+
import type { APIRoute } from "astro";
2+
3+
export const prerender = false;
4+
5+
export const GET: APIRoute = ({ params, request, redirect }) => {
6+
if (!(request.headers.get("user-agent") || "").includes("Ryujinx"))
7+
return redirect("/", 307)
8+
29
return new Response(
310
JSON.stringify({
411
canary: "iurehg8uetgyh8ui5e/cr",
@@ -10,4 +17,4 @@ export async function GET() {
1017
}
1118
}
1219
);
13-
}
20+
};

0 commit comments

Comments
 (0)