NodeJS: request piping cloudfront returns binary but not showing image

by iiro   Last Updated September 11, 2019 19:26 PM - source

I have strange problem. I am piping image from S3/Cloudfront. The image is shown ok when put inside img-tag but not directly when opening in browser.

For example this kind of url:


is piped (fake url below)

const url = ""


http.response is middleware request instance in

  • Chrome shows image like this enter image description here

  • Firefox shows image

  • Internet Explorer 11 tries to download file. Saved file is correct
  • Edge tries to download file. Saved file is correct

What cloud cause this? Thank you for any help :)

Tags : node.js request

Related Questions

NPM request form keeps returning 415 status

Updated January 09, 2019 21:26 PM

NodeJS Response Has No Body

Updated September 15, 2017 01:26 AM

Node js request huge amount of pictures

Updated January 05, 2019 21:26 PM