forked from TrueCloudLab/lego
Fix PowerDNS zone URL, add leading slash (#476)
This commit is contained in:
parent
e2b4c3a54f
commit
ed69aa0cc6
1 changed files with 5 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue