From e8b222493219da88ea58320fe376cb53ef66f958 Mon Sep 17 00:00:00 2001 From: Fran Bull Date: Thu, 27 Feb 2025 07:39:16 -0800 Subject: [PATCH] 401 -> 403 --- tsconsensus/http.go | 2 +- tsconsensus/tsconsensus_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tsconsensus/http.go b/tsconsensus/http.go index cb4aeb628..ec7dd7cc1 100644 --- a/tsconsensus/http.go +++ b/tsconsensus/http.go @@ -104,7 +104,7 @@ func (h authedHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } allowed := h.auth.allowsHost(a) if !allowed { - http.Error(w, "peer not allowed", http.StatusUnauthorized) + http.Error(w, "peer not allowed", http.StatusForbidden) return } h.mux.ServeHTTP(w, r) diff --git a/tsconsensus/tsconsensus_test.go b/tsconsensus/tsconsensus_test.go index 327926f7a..5c2c27536 100644 --- a/tsconsensus/tsconsensus_test.go +++ b/tsconsensus/tsconsensus_test.go @@ -682,8 +682,8 @@ func TestOnlyTaggedPeersCanJoin(t *testing.T) { t.Fatal(err) } defer resp.Body.Close() - if resp.StatusCode != http.StatusUnauthorized { - t.Fatalf("join req when not tagged, expected status: %d, got: %d", http.StatusUnauthorized, resp.StatusCode) + if resp.StatusCode != http.StatusForbidden { + t.Fatalf("join req when not tagged, expected status: %d, got: %d", http.StatusForbidden, resp.StatusCode) } rBody, _ := io.ReadAll(resp.Body) sBody := strings.TrimSpace(string(rBody))