Compare commits

..

No commits in common. "02d281347baeebc8ed7a2f1a55a80014f568f8bb" and "577ce344d1b4d632a631b2f1d613b0fde063dcf5" have entirely different histories.

2 changed files with 10 additions and 2 deletions

View File

@ -138,7 +138,15 @@ func (p *provider) retrieveSubdomainIP(addr string) (string, error) {
return "", fmt.Errorf("%v: %v", utils.ErrIpLenght, ips)
}
return ips[0].String(), nil
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
}
func (p *provider) checkResponse(body []byte, tokenBased bool, ip string) error {

View File

@ -120,7 +120,7 @@ func (w *watcher) retrieveServerIP() (string, error) {
}
var ip string
if strings.Contains(rsp.Header.Get("content-type"), "application/json") {
if 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)