villadora / express-http-proxy

Proxy middleware for express/connect
Other
1.22k stars 236 forks source link

Allow header mod with streaming #505

Open jeremybini opened 2 years ago

jeremybini commented 2 years ago

Currently, streaming mode is disabled if the userResHeaderDecorator response modifier is defined. However, this is overly strict and doesn't allow streaming when we only require access to the response headers, instead of the full response body.

This PR updates the logic to allow streaming if userResHeaderDecorator accepts a single arguments (headers) instead of the full request and response objects.