villadora / express-http-proxy

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

Connection reset on "payload too large" (413) response from target server #546

Open mdmower-csnw opened 4 weeks ago

mdmower-csnw commented 4 weeks ago

When a user attempts to upload a file and the target server responds with HTTP status 413 (payload too large) before reading the entire request body, the proxy often causes "connection reset" instead of forwarding the response to the user.

I observed this while proxying an IIS site but was able to create a minimal reproduction using an express server as well. See repo Proxy connection reset on content too big for code and reproduction steps.

I've reproduced this in Chrome and Firefox on Windows.

Expected result: image

Actual result: image