Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Public pages: a trailing slash gives 404

Chiusa Adatta ai principianti
#56 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Ambito
backend, web-dev

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

bug good first issue hacktoberfest

These answer 404 "not found" on oss.codercops.com today:

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 /interactions and POST /github stay 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 call worker.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=1 keeps ?x=1
  • HEAD gets the same redirect
  • / doesn't change, and POST requests are never redirected
  • Tests for these cases
  • npm run typecheck and npm test pass

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codercops/discord-bot

Tutte le issue di codercops/discord-bot

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.