diff options
| author | Joe Mou <dev@mou.fo> | 2026-09-10 00:53:48 -0400 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-09-10 01:01:04 -0400 |
| commit | 198f2a07f68a348dc0823b2bde3bec541e06db01 (patch) | |
| tree | 96f43ed01ee804f1a90bedad6eecb90b86d5fb3c /cgithub/src/app.test.ts | |
| parent | 95f4269f1a1c3b93ae2b060c7935b03c773e9f4a (diff) | |
Redirect /notifications instead of scraping it as an owner
A signed-out request for github.com/notifications is bounced to a login
page, so the owner route followed that redirect and left the visitor on
/login. Hand the path over to GitHub before it reaches the route.
Diffstat (limited to 'cgithub/src/app.test.ts')
| -rw-r--r-- | cgithub/src/app.test.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cgithub/src/app.test.ts b/cgithub/src/app.test.ts index 8720a23..c028e1b 100644 --- a/cgithub/src/app.test.ts +++ b/cgithub/src/app.test.ts @@ -441,6 +441,13 @@ describe("redirects to GitHub", () => { ); }); + it("should redirect notifications without scraping them as a profile", async () => { + const res = await app.request("http://cgithub.example/notifications?query=is%3Aunread"); + + assert.strictEqual(res.status, 200); + assert.match(await res.text(), /url=https:\/\/github.com\/notifications\?query=is%3Aunread"/); + }); + it("should redirect raw file requests to raw.githubusercontent.com", async () => { const res = await app.request("http://cgithub.example/actions/deploy-pages/raw/main/README.md"); |
