fix: harden scaffold after review — manifest drift check, vet-safe logging, panic-path header guard

This commit is contained in:
2026-08-20 00:26:28 +01:00
parent 2469918d7d
commit d5bff28c5c
5 changed files with 170 additions and 18 deletions
+4 -3
View File
@@ -125,10 +125,11 @@ func newGateway(ctx context.Context, next http.Handler, config *Config, name str
// ServeHTTP is the internal router. It grows in later tasks.
func (g *Gateway) ServeHTTP(w http.ResponseWriter, r *http.Request) {
defer recoverPanic(w, g)
sw := &statusTrackingWriter{ResponseWriter: w}
defer recoverPanic(sw, g)
if g.cfg.PassthroughUnknown {
g.next.ServeHTTP(w, r)
g.next.ServeHTTP(sw, r)
return
}
writeOAIError(w, http.StatusNotFound, "invalid_request_error", "unknown route")
writeOAIError(sw, http.StatusNotFound, "invalid_request_error", "unknown route")
}