update for strict config (#3779)

This commit is contained in:
fatedier
2023-11-16 21:03:36 +08:00
committed by GitHub
parent e8deb65c4b
commit 526e809bd5
15 changed files with 99 additions and 70 deletions

View File

@@ -6,6 +6,7 @@ import (
"io"
"net"
"net/http"
"net/url"
"strconv"
"strings"
@@ -69,8 +70,16 @@ func (c *Client) GetAllProxyStatus() (client.StatusResp, error) {
return allStatus, nil
}
func (c *Client) Reload() error {
req, err := http.NewRequest("GET", "http://"+c.address+"/api/reload", nil)
func (c *Client) Reload(strictMode bool) error {
v := url.Values{}
if strictMode {
v.Set("strictConfig", "true")
}
queryStr := ""
if len(v) > 0 {
queryStr = "?" + v.Encode()
}
req, err := http.NewRequest("GET", "http://"+c.address+"/api/reload"+queryStr, nil)
if err != nil {
return err
}