소스 검색

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 년 전
부모
커밋
84494edab4
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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
 		}
 
-		http.Error(w, "Debugging disabled", http.StatusBadRequest)
+		http.Error(w, "Debugging disabled", http.StatusForbidden)
 	})
 }