From 18f23c4dcf6b41a0c4acb439eb8fafb55b0279ee Mon Sep 17 00:00:00 2001 From: Timothy Date: Wed, 4 Sep 2019 10:33:25 +0800 Subject: [PATCH] fix basic auth issue --- handler/google/google_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler/google/google_handler.go b/handler/google/google_handler.go index 5583eee..c1fefb8 100644 --- a/handler/google/google_handler.go +++ b/handler/google/google_handler.go @@ -78,11 +78,11 @@ func (handler *Handler) DomainLoop(domain *godns.Domain, panicChan chan<- godns. func (handler *Handler) UpdateIP(domain, subDomain, currentIP string) { values := url.Values{} values.Add("hostname", fmt.Sprintf("%s.%s", subDomain, domain)) - values.Add("username:password", fmt.Sprintf("%s:%s", handler.Configuration.Email, handler.Configuration.Password)) values.Add("myip", currentIP) client := godns.GetHttpClient(handler.Configuration) req, _ := http.NewRequest("POST", GoogleUrl, strings.NewReader(values.Encode())) + req.SetBasicAuth(handler.Configuration.Email, handler.Configuration.Password) if handler.Configuration.UserAgent != "" { req.Header.Add("User-Agent", handler.Configuration.UserAgent)