mirror of
https://github.com/cert-manager/webhook-example.git
synced 2026-03-16 18:02:51 +01:00
hash url path (including leading /) instead of full url
This commit is contained in:
parent
9c8aeffea3
commit
23ae00ce0d
1 changed files with 3 additions and 3 deletions
|
|
@ -15,12 +15,12 @@ var (
|
|||
)
|
||||
|
||||
func SetTXTRecord(domain string, resolvedFqdn string, key string, login string, apiKey string) error {
|
||||
resolvedFqdn = strings.TrimSuffix(resolvedFqdn, domain)
|
||||
requestUrl := fmt.Sprintf("%s/dns/%s", baseUrl, domain)
|
||||
urlPath := fmt.Sprintf("/dns/%s/addRR", domain)
|
||||
requestUrl := fmt.Sprintf("%s%s", baseUrl, urlPath)
|
||||
|
||||
values := url.Values{"name": {resolvedFqdn}, "type": {"TXT"}, "data": {key}}
|
||||
body := values.Encode()
|
||||
authHeader, err := auth.GetAuthHeader(login, apiKey, requestUrl, body)
|
||||
authHeader, err := auth.GetAuthHeader(login, apiKey, urlPath, body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue