1
0
Fork 0

Update Lego (Gandi API v5, cloudxns, ...)

This commit is contained in:
Ludovic Fernandez 2018-02-12 18:10:05 +01:00 committed by Traefiker Bot
parent dd873fbeee
commit 7d3dd5a0e4
43 changed files with 4112 additions and 1238 deletions

View file

@ -257,12 +257,11 @@ func (c *DNSProvider) makeRequest(method, uri string, body io.Reader) (json.RawM
if c.host.Path != "/" {
path = c.host.Path
}
if c.apiVersion > 0 {
if !strings.HasPrefix(uri, "api/v") {
uri = "/api/v" + strconv.Itoa(c.apiVersion) + uri
} else {
uri = "/" + uri
}
if !strings.HasPrefix(uri, "/") {
uri = "/" + uri
}
if c.apiVersion > 0 && !strings.HasPrefix(uri, "/api/v") {
uri = "/api/v" + strconv.Itoa(c.apiVersion) + uri
}
url := c.host.Scheme + "://" + c.host.Host + path + uri
req, err := http.NewRequest(method, url, body)