From fe7e6c348b19c58c83ff80ef635c30d0ad4f21d7 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Mon, 26 Jan 2026 13:03:55 -0500 Subject: Raw route that just redirects to GitHub --- src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/index.ts b/src/index.ts index 43d4cfa..15d464a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -35,6 +35,12 @@ app.get("/:owner/:repo/blob/:branch/:path{.*}", async (c) => { return c.html(await eta.renderAsync("blob.eta", data)); }); +app.get("/:owner/:repo/raw/:branch/:path{.*}", async (c) => { + const { owner, repo, branch, path } = c.req.param(); + c.header("Referrer-Policy", "no-referrer"); + return c.redirect(`https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${path}`); +}); + if (process.env.LISTEN_FDS === "1") { const server = createAdaptorServer(app); // Listen on SD_LISTEN_FDS_START. -- cgit v1.3.1