From 244cb370a438cdf663370bc6bfb0ad784a219b4b Mon Sep 17 00:00:00 2001 From: ayanamist Date: Mon, 21 Jun 2021 17:33:34 +0800 Subject: [PATCH] Change: config reload API use default path when both path and payload don't exist (#1447) --- hub/route/configs.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hub/route/configs.go b/hub/route/configs.go index 315180f7..48cb95ed 100644 --- a/hub/route/configs.go +++ b/hub/route/configs.go @@ -6,6 +6,7 @@ import ( "github.com/Dreamacro/clash/component/resolver" "github.com/Dreamacro/clash/config" + "github.com/Dreamacro/clash/constant" "github.com/Dreamacro/clash/hub/executor" P "github.com/Dreamacro/clash/listener" "github.com/Dreamacro/clash/log" @@ -116,6 +117,9 @@ func updateConfigs(w http.ResponseWriter, r *http.Request) { return } } else { + if req.Path == "" { + req.Path = constant.Path.Config() + } if !filepath.IsAbs(req.Path) { render.Status(r, http.StatusBadRequest) render.JSON(w, r, newError("path is not a absolute path"))