diff --git a/cmd/generic-handlers.go b/cmd/generic-handlers.go index 6529d4067..a6886a2ad 100644 --- a/cmd/generic-handlers.go +++ b/cmd/generic-handlers.go @@ -306,6 +306,7 @@ func setHTTPStatsHandler(h http.Handler) http.Handler { if strings.HasPrefix(r.URL.Path, storageRESTPrefix) || strings.HasPrefix(r.URL.Path, peerRESTPrefix) || + strings.HasPrefix(r.URL.Path, peerS3Prefix) || strings.HasPrefix(r.URL.Path, lockRESTPrefix) { globalConnStats.incInputBytes(meteredRequest.BytesRead()) globalConnStats.incOutputBytes(meteredResponse.BytesWritten()) diff --git a/cmd/handler-utils.go b/cmd/handler-utils.go index a83cecacf..99b1eb6ef 100644 --- a/cmd/handler-utils.go +++ b/cmd/handler-utils.go @@ -403,6 +403,12 @@ func errorResponseHandler(w http.ResponseWriter, r *http.Request) { } desc := "Do not upgrade one server at a time - please follow the recommended guidelines mentioned here https://github.com/minio/minio#upgrading-minio for your environment" switch { + case strings.HasPrefix(r.URL.Path, peerS3Prefix): + writeErrorResponseString(r.Context(), w, APIError{ + Code: "XMinioPeerS3VersionMismatch", + Description: desc, + HTTPStatusCode: http.StatusUpgradeRequired, + }, r.URL) case strings.HasPrefix(r.URL.Path, peerRESTPrefix): writeErrorResponseString(r.Context(), w, APIError{ Code: "XMinioPeerVersionMismatch", diff --git a/cmd/peer-s3-server.go b/cmd/peer-s3-server.go index 0c81ca894..5137437b1 100644 --- a/cmd/peer-s3-server.go +++ b/cmd/peer-s3-server.go @@ -33,7 +33,7 @@ const ( peerS3Version = "v1" // First implementation peerS3VersionPrefix = SlashSeparator + peerS3Version - peerS3Prefix = minioReservedBucketPath + "/peer" + peerS3Prefix = minioReservedBucketPath + "/peer-s3" peerS3Path = peerS3Prefix + peerS3VersionPrefix )