fix(ws): guard against writing to destroyed socket#113
Conversation
|
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 (3)
✨ 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 #113 +/- ##
==========================================
- Coverage 96.11% 95.97% -0.15%
==========================================
Files 8 8
Lines 644 646 +2
Branches 244 244
==========================================
+ Hits 619 620 +1
Misses 24 24
- Partials 1 2 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c51e828 to
ea290d0
Compare
ea290d0 to
f30f90f
Compare
|
Closing — the fix in this PR was fully superseded by #116, which covers the same destroyed-socket guards in |
Summary
socket.destroyedandsocket.writablebefore writing a non-upgrade HTTP response back to the client socket in WS proxy pathsProxyServer.ws()(middleware) and standaloneproxyUpgrade()proxyUpgrade(), the rejection promise is now always fired for non-upgrade responses regardless of socket stateUpstream reference: http-party/node-http-proxy#1433
Test plan
ProxyServer.ws()andproxyUpgrade()code paths