fix(server): gate WebSocket on ban and rate limit, map errors to status

The WebSocket route skipped the ban and rate-limit checks that the HTTP
path enforced, and returned errors set no custom status, so circuit-open
became HTTP 500. The route now runs the same ban and rate-limit checks
before the upgrade, and a custom error handler maps errors to the
correct status, including 503 for circuit-open. The API and admin
listeners honour the BIND_ADDRESS option.
This commit is contained in:
2026-08-14 11:10:54 +01:00
parent 044fa41744
commit 70b86c779b
5 changed files with 355 additions and 14 deletions
-1
View File
@@ -161,7 +161,6 @@ func TestAdminDashboard_GetCircuitBreakerStatus(t *testing.T) {
cfg = &config{
Logger: logger,
CircuitBreaker: struct {
EndpointConfigs map[string]*EndpointCBConfig
ExcludedStatusCodes []int
MaxFailures int
FailureRatio float64