tomas / needle

Nimble, streamable HTTP client for Node.js. With proxy, iconv, cookie, deflate & multipart support.

Home Page:https://www.npmjs.com/package/needle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

zotakk4o opened this issue · comments

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?