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

Response inherits from Stream instead of Stream.Readable (requiring request module browserify workaround)

Aperta
#81 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, node.js
Ambito
web-dev

Direzione di ricerca

Inizia dalla definizione di Response in http-browserify e dalla relativa chiamata a util.inherits, quindi confrontala con l’ereditarietà di IncomingMessage di Node mostrata nell’issue. Controlla il workaround in request.js e determina se la conversione di Response in Streams2 richiede modifiche oltre all’ereditarietà. Il lavoro è completo quando la risposta del browser espone l’API Readable prevista, incluso resume(), senza questo workaround di compatibilità.

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

Descrizione

On node.js, the HTTP response object (which is named IncomingMessage in node.js) inherits from Stream.Readable:

util.inherits(IncomingMessage, Stream.Readable);

but in http-browserify, it only inherits from Stream:

util.inherits(Response, Stream);

This means the full stream API is not available as it is in Node, including the .resume() method. I believe this is the reason for this hack in the request module:

  } else if (response.resume) {
    // response.resume should be defined, but check anyway before calling.
    // Workaround for browserify.
    response.resume()
  }

to improve compatibility would it be possible for http-browserify Response to inherit from Stream.Readable? (are there any other changes needed than changing the utils.inherits call?)

edit: Stream is old-style (pre-0.10); this amounts to converting http-browserify to Streams2

Lingua principale
JavaScript
Stelle
245
Fork
104
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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 browserify/http-browserify

Tutte le issue di browserify/http-browserify

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.