Public pages: a trailing slash gives 404
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Leggi route in src/index.ts, soprattutto i reindirizzamenti esistenti e il 404 finale, poi esamina i test dei reindirizzamenti in test/index.test.ts e il modo in cui chiamano worker.fetch. Aggiungi test per i reindirizzamenti con barra finale su GET e HEAD, la conservazione della stringa di query, / e le richieste POST. Il lavoro è completato quando passano i reindirizzamenti e le esclusioni richiesti, insieme a npm run typecheck e npm test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
These answer 404 "not found" on oss.codercops.com today:
- https://oss.codercops.com/leaderboard/
- https://oss.codercops.com/leaderboard/2026-10/
- https://oss.codercops.com/leaderboard/2026-10/u/bhushan4work/
Without the trailing slash, all three load. A slash is easy to add by hand or when someone copies a link, and the page should still open.
The page patterns end at $ with no optional / (LEADERBOARD_PATH and LEADERBOARD_IMAGE_PATH in src/programs.ts, lines 32 and 35, and CONTRIBUTOR_PATH in src/index.ts, line 214), so these paths fall through to the 404 at the end of route (src/index.ts, line 378).
What to do
- In
route(src/index.ts, line 341), answer a GET or HEAD for a path that ends in/(other than/itself) with a 301 to the same path without the trailing slashes, and keep the query string. - Only GET and HEAD:
POST /interactionsandPOST /githubstay as they are.
Where to look
src/index.ts:route(line 341), the existing redirects (lines 353 to 358) and the 404 (line 378)test/index.test.ts: the redirect tests start at line 106 and show how to callworker.fetch
Acceptance criteria
-
/leaderboard/,/leaderboard/2026-10/and/leaderboard/2026-10/u/ada/answer a 301 to the same path without the slash, and/leaderboard/2026-10/?x=1keeps?x=1 - HEAD gets the same redirect
-
/doesn't change, and POST requests are never redirected - Tests for these cases
-
npm run typecheckandnpm testpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #56 in the description.
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 1
- Merge medio
- 12h 22m
- PR unite (30g)
- 36
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codercops/discord-bot
-
Merged PR shoutout: ask people who haven't linked their GitHub to run /linkForse già presa @princecherry9905 l’ha presa oggi. Apertaenhancement good first issue hacktoberfest
codercops/discord-bot#66 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Merged PR shoutout misses the count when the program label is added after the mergeForse già presa @An16og l’ha presa oggi. Apertabug hacktoberfest help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
codercops/discord-bot#59 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Leaderboard page: name the people who qualify but haven't linked their GitHub yetForse già presa @varun-pahuja l’ha presa 1 giorno fa. Apertaenhancement hacktoberfest help wanted
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
codercops/discord-bot#55 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
hacktoberfest
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 15/100
codercops/discord-bot#15 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di codercops/discord-bot
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
zts212653/clowder-ai#1678 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
Progressive-Victory/the-website#680 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100