From bd28d92a9800ad5b2d66b2a5491f58a7e76a5feb Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Mon, 26 Jan 2026 13:41:55 -0500 Subject: Redirect any unhandled routes to GitHub --- src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/index.ts b/src/index.ts index 15d464a..38d6d13 100644 --- a/src/index.ts +++ b/src/index.ts @@ -41,6 +41,12 @@ app.get("/:owner/:repo/raw/:branch/:path{.*}", async (c) => { return c.redirect(`https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${path}`); }); +app.all("*", async (c) => { + const path = c.req.path; + c.header("Referrer-Policy", "no-referrer"); + return c.redirect(`https://github.com${path}`); +}); + if (process.env.LISTEN_FDS === "1") { const server = createAdaptorServer(app); // Listen on SD_LISTEN_FDS_START. -- cgit v1.3.1