Repository navigation
Conversation
Validate HTTP and HTTPS ports before binding, preserving asynchronous bind failures. Adapt the net string-routing and Unicode whitespace fixes from oven-sh#34083.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (3)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughServer ChangesServer listen port handling
Suggested reviewers: Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to This change makes invalid listen ports throw synchronously, as Node does, and keeps address-in-use failures asynchronous. The supplied evidence shows no outstanding merge-blocking risk. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Port validation becomes stricter without weakening the numeric range controls. The main security-relevant change is endpoint selection when port and path inputs overlap. No introduced authorization bypass was established, but downstream deployment exposure and cancellation-after-failure behavior remain incompletely assessed. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Comment |
http.Server.listen(65536)andhttps.Server.listen(65536)now throwRangeErrorwithERR_SOCKET_BAD_PORTsynchronously, like Node 24. Real bind failures such asEADDRINUSEremain asynchronouserrorevents.HTTP currently lets
Bun.serve()validate the port inside the bind-error catch. The fix validates before binding, preserves the original string until validation, and converts the complete numeric string instead of accepting aparseInt()prefix. Numeric ports take precedence over an accompanying path. The net portion preserves whitespace strings for validation and uses Node's pipe-name routing.Adapts the net string-routing and U+3000 validation changes from #34083, which remains open; thanks @robobun. This also covers HTTP/HTTPS timing and the full port overload matrix.
Proof:
aa8307619d8dccbda113a5a4aa1885e0cef7eabafails 36 of them and passes 39.The fork counterpart is openclaw#101; Linux x64 and macOS arm64 native CI passed before its guarded squash merge.