fix(web-incoming): remove deprecated request abort APIs#107
Conversation
…ed")`
Replace deprecated `proxyReq.abort()` with `proxyReq.destroy()` and remove
redundant `req.on("aborted")` listener that was broken on Node 16+.
The `res.on("close")` handler already covers client disconnect cleanup.
Upstream: http-party/node-http-proxy#1580
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #107 +/- ##
==========================================
+ Coverage 96.14% 96.29% +0.14%
==========================================
Files 8 8
Lines 623 621 -2
Branches 233 233
==========================================
- Hits 599 598 -1
+ Misses 24 23 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
req.on("aborted")listener — broken on Node 16+ and redundant sinceres.on("close")already handles client disconnect cleanupproxyReq.abort()calls withproxyReq.destroy()(bothabort()and theabortedevent were deprecated in Node 16)Upstream reference: http-party/node-http-proxy#1580
Details
httpxy already had the core fix (
res.on("close", () => proxyReq.destroy())) but still carried the deprecatedreq.on("aborted")listener and usedproxyReq.abort()in timeout/error handlers. This PR completes the cleanup:req.on("aborted")— Removed. Theabortedevent onIncomingMessagewas deprecated in Node 16. The existingres.on("close")with!res.writableFinishedguard already handles client disconnects correctly.proxyReq.abort()— Replaced withproxyReq.destroy()in three locations: proxy timeout handler, error handler (ECONNRESET), and redirect timeout handler.Test plan