cmd/ctrld: update config when "--cd" present

This commit is contained in:
Cuong Manh Le
2023-01-06 23:56:26 +07:00
committed by Cuong Manh Le
parent 6edd42629e
commit 9f90811567
3 changed files with 50 additions and 30 deletions
+3
View File
@@ -41,6 +41,9 @@ func FetchResolverConfig(uid string) (*ResolverConfig, error) {
if err != nil {
return nil, fmt.Errorf("http.NewRequest: %w", err)
}
q := req.URL.Query()
q.Set("platform", "ctrld")
req.URL.RawQuery = q.Encode()
req.Header.Add("Content-Type", "application/json")
client := http.Client{Timeout: 5 * time.Second}
resp, err := client.Do(req)