tomas / needle

Nimble, streamable HTTP client for Node.js. With proxy, iconv, cookie, deflate & multipart support.
https://www.npmjs.com/package/needle
MIT License
1.62k stars 235 forks source link

Piping needle request to Express response won't set the correct headers #408

Open zotakk4o opened 2 years ago

zotakk4o commented 2 years ago

Hi,

Having the following express server example: app.get('/', (req, res) => needle.request('get', 'www.google.com').pipe(res)); The response does not contain the appropriate headers. For example, content-type is missing and the response is treated as text, not as HTML.

Any ideas how I can fix this?