浏览代码

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)
 	})
 }