Open
Description
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
Metadata
Metadata
Assignees
Labels
No labels