chore: finalize lab7 security verification
CI / verify (pull_request) Successful in 14m53s

This commit is contained in:
2026-11-06 22:00:42 +03:00
parent 5ac64f51fa
commit a8edaf058d
53 changed files with 1130 additions and 224 deletions
+4
View File
@@ -115,6 +115,7 @@ func (s *Server) MetricsHandler() http.Handler {
}
func (s *Server) serveHealth(w http.ResponseWriter, r *http.Request, handler requestHandler) {
w.Header().Set("X-Instance-Id", s.instanceID)
if err := handler(w, r); err != nil {
writeError(w, "", err)
}
@@ -168,6 +169,9 @@ func (s *Server) serve(w http.ResponseWriter, r *http.Request) {
if apiErr.status == http.StatusUnauthorized {
wrapped.Header().Set("WWW-Authenticate", authenticationChallenge(r))
}
if apiErr.status == http.StatusTooManyRequests && wrapped.Header().Get("Retry-After") == "" {
wrapped.Header().Set("Retry-After", "1")
}
writeError(wrapped, requestID, apiErr)
}
}