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

fetch_url: the timeout aborts a slow body read, and the response charset is ignored

Chiusa
#189 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à
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Start with src/main/tools/web.ts, especially readBodyCapped and the referenced timeout and decoding locations at lines 148–154, 217–219, and 46–63. Check how timeout aborts differ from user aborts and how the response content type is available. Done means timed-out body reads preserve already-read data as truncated (or use separate header/body timeouts), and declared charsets decode correctly with UTF-8 fallback for unknown labels.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug priority: low severity: low

Found in the 2026-10-07 code review (read).

Problem

  • Timeout: AbortSignal.timeout(FETCH_TIMEOUT_MS) (src/main/tools/web.ts:148-154,217-219) also aborts reading the body. A page still streaming after 15 s fails with "The operation was aborted due to timeout", and up to 2 MB already read is thrown away.
  • Charset: the body is always decoded as UTF-8 (web.ts:46-63), so Latin-1 and Shift-JIS pages come out garbled.

Fix

  • In readBodyCapped, when the timeout (not the user) caused the abort, return what was read with truncated: true. Or use separate timeouts for the headers and the body.
  • Use new TextDecoder(charsetFrom(contentType) ?? 'utf-8', { fatal: false }), falling back to UTF-8 for unknown labels.
Lingua principale
TypeScript
Stelle
2
Fork
2
Merge medio
5h 28m
PR unite (30g)
24

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 PierrunoYT/patch

Tutte le issue di PierrunoYT/patch

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.