fix(web-incoming): guard req.socket access in error handler#112
Conversation
use optional chaining for `req.socket?.destroyed` to prevent TypeError crash when `req.socket` is undefined (e.g. HTTP/2). ref: http-party/node-http-proxy#1634
|
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #112 +/- ##
==========================================
+ Coverage 96.14% 97.49% +1.34%
==========================================
Files 8 8
Lines 623 679 +56
Branches 233 269 +36
==========================================
+ Hits 599 662 +63
+ Misses 24 17 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
req.socketwith optional chaining (req.socket?.destroyed) in thecreateErrorHandlerclosure within thestreammiddlewareTypeError: Cannot read properties of undefined (reading 'destroyed')crash whenreq.socketis undefined (e.g. HTTP/2 requests or edge-case teardown scenarios)Upstream ref: http-party/node-http-proxy#1634