From 0e9854372ef81402fd3e81e0f7bbe852896f2ef7 Mon Sep 17 00:00:00 2001 From: Anis Eleuch Date: Wed, 13 Nov 2024 13:07:28 +0100 Subject: [PATCH] heal/batch: Fix missing redirection to the first node (#20642) Manual heal can return XMinioHealInvalidClientToken if the manual healing is started in the first node, and the next mc call to get the heal status is landed on another node. The reason is that redirection based on the token ID is not able to redirect requests to the first node due to a typo. This also affects the batch cancel command if the batch is being done in the first node, the user will never be able to cancel it due to the same bug. --- cmd/bucket-listobjects-handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/bucket-listobjects-handlers.go b/cmd/bucket-listobjects-handlers.go index 1dafdfb5a..7f3134f17 100644 --- a/cmd/bucket-listobjects-handlers.go +++ b/cmd/bucket-listobjects-handlers.go @@ -245,7 +245,7 @@ func parseRequestToken(token string) (subToken string, nodeIndex int) { func proxyRequestByToken(ctx context.Context, w http.ResponseWriter, r *http.Request, token string) (string, bool) { subToken, nodeIndex := parseRequestToken(token) - if nodeIndex > 0 { + if nodeIndex >= 0 { return subToken, proxyRequestByNodeIndex(ctx, w, r, nodeIndex) } return subToken, false