Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

https.request response objects aren't readable streams #3882

@lerouxb

Description

@lerouxb

UPDATE 2: I was completely confused here. The problem is really that https.get doesn't take a url string, I didn't notice the error (or it wasn't particularly clear or obvious) and then I tried to read from the request as if it was working/valid anyway.


I'm sending the response object I get from http.request() straight to graphicsmagick's identify and it works fine. If I try the same thing with an https url and therefore https.request() it fails badly. This is for resources that are accessible under the exact same urls securely (https, port 443 ) or over plain http (port 80), so I know they are exactly the same images and as long as the response objects behave as readable streams in both cases the problem cannot lie with graphicsmagick (https://github.com/aheckmann/gm).

The documentation shows that http.request (http://nodejs.org/api/http.html#http_http_request_options_callback) and https.request (http://nodejs.org/api/https.html#https_https_request_options_callback) have the same method signature, take the same options and both even have the same .get() shortcuts, so it would make sense if the response objects that get sent to the callback act as readable streams in both cases.

It looks like the intention is for them to have the same interface. Is this correct?

This is with node version 0.8.7.

UPDATE: Here's a gist that demonstrates the issue: https://gist.github.com/3382480

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions