Dashboardopencode-loreServer access, binding, and bounded shu…

Server access, binding, and bounded shutdown

Category: architecture
Confidence: 1.00
ID: 01a09194-26e0-7e64-b381-e5b022945df7
Project ID: 6f4be9ff-ed84-4cca-a9e7-732a0b0b8677
Cross-project: No
Recalled in other projects: 0
Source session: 1RMlaPGz62gyKtKoS
Created: 2026-08-28 03:17:29
Updated: 2026-09-11 17:46:40

Content

Authorize management and data-plane requests from the numeric node:http socket peer before CORS, imports, body reads, authentication, storage, or upstream calls; never trust Host, Origin, Forwarded, or X-Forwarded-For as peer identity. Non-loopback peers get bodyless 404s unless remote management is enabled, which additionally requires exact normalized Host/port matching and rejects loopback browser Origins. Apply this to startServer(), upgrades, /, /api, and /ui. Warn visibly when an explicitly configured host is skipped for EADDRNOTAVAIL/EADDRNOTFOUND; continue only if another host binds. For shutdown, track every socket through close, then use deadline-driven closeIdleConnections(), closeAllConnections(), and explicit destruction because partial headers and upgraded sockets can outlive server.close(). Keep closure bounded and idempotent.

Move to: