From 7c8746732bf44a5456f42620b0c3ab16405d9479 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Tue, 22 Aug 2023 11:10:41 -0700 Subject: [PATCH] Return cancelled storage calls as 499 (#17895) Make upstream cancels more visible - right now they are just reported as "forbidden". --- cmd/storage-rest-server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/storage-rest-server.go b/cmd/storage-rest-server.go index 5fb896e30..73c016ab5 100644 --- a/cmd/storage-rest-server.go +++ b/cmd/storage-rest-server.go @@ -64,6 +64,8 @@ func (s *storageRESTServer) writeErrorResponse(w http.ResponseWriter, err error) w.WriteHeader(http.StatusNotFound) case errInvalidAccessKeyID, errAccessKeyDisabled, errNoAuthToken, errMalformedAuth, errAuthentication, errSkewedAuthTime: w.WriteHeader(http.StatusUnauthorized) + case context.Canceled, context.DeadlineExceeded: + w.WriteHeader(499) default: w.WriteHeader(http.StatusForbidden) }