Compare commits
2 Commits
577ce344d1
...
02d281347b
Author | SHA1 | Date |
---|---|---|
DataHearth | 02d281347b | |
DataHearth | 978d541503 |
|
@ -138,15 +138,7 @@ func (p *provider) retrieveSubdomainIP(addr string) (string, error) {
|
|||
return "", fmt.Errorf("%v: %v", utils.ErrIpLenght, ips)
|
||||
}
|
||||
|
||||
ip := ips[0].String()
|
||||
if strings.Contains(ip, ":") {
|
||||
ip, _, err = net.SplitHostPort(ip)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("%v: %v", utils.ErrSplitAddr, ip)
|
||||
}
|
||||
}
|
||||
|
||||
return ip, nil
|
||||
return ips[0].String(), nil
|
||||
}
|
||||
|
||||
func (p *provider) checkResponse(body []byte, tokenBased bool, ip string) error {
|
||||
|
|
|
@ -120,7 +120,7 @@ func (w *watcher) retrieveServerIP() (string, error) {
|
|||
}
|
||||
|
||||
var ip string
|
||||
if rsp.Header.Get("content-type") == "application/json" {
|
||||
if strings.Contains(rsp.Header.Get("content-type"), "application/json") {
|
||||
body := make(map[string]interface{})
|
||||
if err := json.Unmarshal(b, &body); err != nil {
|
||||
return "", fmt.Errorf("failed to unmarshal JSON body: %v", err)
|
||||
|
|
Loading…
Reference in New Issue