Skip to content

Commit aac88d9

Browse files
Copilotlpcox
andcommitted
fix: restore shutdownErrorJSON constant as production reference in rejectIfShutdown
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
1 parent 00c53dd commit aac88d9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

internal/server/routed.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package server
22

33
import (
44
"context"
5+
"encoding/json"
56
"fmt"
67
"log"
78
"net/http"
@@ -22,7 +23,7 @@ func rejectIfShutdown(unifiedServer *UnifiedServer, next http.Handler, logNamesp
2223
if unifiedServer.IsShutdown() {
2324
log.Printf("Rejecting request during shutdown: remote=%s, method=%s, path=%s", r.RemoteAddr, r.Method, r.URL.Path)
2425
logger.LogWarn("shutdown", "Request rejected during shutdown, remote=%s, path=%s", r.RemoteAddr, r.URL.Path)
25-
writeJSONResponse(w, http.StatusServiceUnavailable, map[string]string{"error": "Gateway is shutting down"})
26+
writeJSONResponse(w, http.StatusServiceUnavailable, json.RawMessage(shutdownErrorJSON))
2627
return
2728
}
2829
next.ServeHTTP(w, r)

0 commit comments

Comments
 (0)