401 -> 403

This commit is contained in:
Fran Bull committed 2025-02-27 07:39:16 -08:00
1 parent 69f76641ac
commit e8b2224932
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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))