Skip to content

fix(proxy): cancel upstream requests before response headers - #135

Open
YeautyYE wants to merge 1 commit into
shaobeichen:mainfrom
YeautyYE:fix/proxy-cancel-before-headers
Open

YeautyYE wants to merge 1 commit into
shaobeichen:mainfrom
YeautyYE:fix/proxy-cancel-before-headers

Conversation

@YeautyYE

Copy link
Copy Markdown

Cancelling an HTTP request before the upstream server sends response headers now closes the upstream request. Previously, navigating away from an expensive history search could leave that search running and delay subsequent requests. Disconnects also stop buffered HTML and error responses; finishing an upload normally still leaves its response pending.

The proxy registers disconnect cleanup when it creates the upstream request and avoids writing errors to a response that has already closed.

Validation: npm test (178 passed); seven HTTP cancellation regressions also passed on Windows Node 24.20.0. GET, POST, and partial-upload cancellation tests fail on v2.10.6 before this fix. Two independent runs of the new test file passed concurrently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant