Skip to content

http.ServerResponse is not recognized as ReadableStream #334

@viktorasm

Description

@viktorasm

using GCS, when creating a new object, i tried to directly pipe in a http response, but API does not recognize it as readable stream.

http.get('http://www.example.com/image.jpeg', function(response){
    storage.objects.insert({bucket: 'my-bucket',name:'testThing',media:{body:response}}, function (err,uploadResult){
        if (err){
            console.log('err',err);
            return res.status(500).send('upload failed');
        }
        return res.status(201).send({id:123456});
    })
})

Providing a pull request that fixes it for me.

Metadata

Metadata

Labels

🚨This issue needs some love.triage meI really want to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions