Browse Source

cmd/syncthing: Return "Forbidden" for REST API debug endpoints when debugging disabled

The previous "Bad Request" was really confusing as it implies it's
somethign wrong with the request, which there isn't - the problem is
that server configuration forbids the request.
Jakob Borg 7 years ago
parent
commit
84494edab4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      cmd/syncthing/gui.go

+ 1 - 1
cmd/syncthing/gui.go

@@ -592,7 +592,7 @@ func (s *apiService) whenDebugging(h http.Handler) http.Handler {
 			return
 			return
 		}
 		}
 
 
-		http.Error(w, "Debugging disabled", http.StatusBadRequest)
+		http.Error(w, "Debugging disabled", http.StatusForbidden)
 	})
 	})
 }
 }