fix: 注册 PUT /api/manager/settings 使设置保存生效

server.go NewServeMux 按方法分发到 handleSettingsPut(原仅注册 GET,PUT 静默返回旧值)

新增 TestSettingsPutRoundTrip 回归测试;gofmt 清理历史格式问题
This commit is contained in:
2026-08-17 12:00:34 +08:00
parent 1cd0ab8ad1
commit 5237e3b594
5 changed files with 66 additions and 22 deletions

View File

@ -257,8 +257,6 @@ func (h *Handler) handleProfile(w http.ResponseWriter, r *http.Request) {
// ---- helpers ----
// tailFile returns the last maxBytes bytes of a file.
func tailFile(path string, maxBytes int64) (string, error) {
info, err := os.Stat(path)
@ -280,4 +278,3 @@ func tailFile(path string, maxBytes int64) (string, error) {
}
return string(buf), nil
}