unjs / httpxy

🔀 A Full-Featured HTTP and WebSocket Proxy for Node.js
Other
194 stars 12 forks source link

Please remove `followRedirects` from options since it does not support 🙏🏻 #57

Open kricsleo opened 3 months ago

kricsleo commented 3 months ago

Environment

nodejs: v20.12.0

Reproduction

Just look at the code is enough.

Describe the bug

node-http-proxy supports followRedirects, but this rewrite removed this feature.

This should be documented in the readme or with an accurate ProxyServerOptions, instead of just saying "Checkout http-party/node-http-proxy for more options and examples.".

I was misled by it and spent quite a time debugging it until I looked at the source code and saw this commented line 😢 .

https://github.com/unjs/httpxy/blob/07778fb8984c7f63d5cd00e38b787e7da27209fc/src/middleware/web-incoming.ts#L68

Just remove this config from the ProxyServerOptions interface or document this would be less misleading 🙏🏻.

https://github.com/unjs/httpxy/blob/07778fb8984c7f63d5cd00e38b787e7da27209fc/src/types.ts#L68

(Still thanks for the rewrite, and I'm willing to contribute ❤️ )

Additional context

No response

Logs

No response