Trim '.' per specification
This commit is contained in:
parent
fb99ace026
commit
131d3b2387
@ -35,7 +35,7 @@ const URI_DELETE_RECORD = "https://freedns.afraid.org/subdomain/delete2.php?data
|
|||||||
// const URI_LOGIN string = "http://127.0.0.1:1234/"
|
// const URI_LOGIN string = "http://127.0.0.1:1234/"
|
||||||
|
|
||||||
func GetDomainFromZone(Zone string) string {
|
func GetDomainFromZone(Zone string) string {
|
||||||
_segs := strings.Split(Zone, ".")
|
_segs := strings.Split(strings.TrimRight(Zone, "."), ".")
|
||||||
_segs = _segs[len(_segs)-2:]
|
_segs = _segs[len(_segs)-2:]
|
||||||
return strings.Join(_segs, ".")
|
return strings.Join(_segs, ".")
|
||||||
}
|
}
|
||||||
|
2
main.go
2
main.go
@ -133,7 +133,7 @@ func (c *customDNSProviderSolver) Present(ch *v1alpha1.ChallengeRequest) error {
|
|||||||
func (c *customDNSProviderSolver) CleanUp(ch *v1alpha1.ChallengeRequest) error {
|
func (c *customDNSProviderSolver) CleanUp(ch *v1alpha1.ChallengeRequest) error {
|
||||||
|
|
||||||
_key := "\"" + ch.Key + "\""
|
_key := "\"" + ch.Key + "\""
|
||||||
_id, err := c.freedns.FindRecord(ch.ResolvedZone, "TXT", _key)
|
_id, err := c.freedns.FindRecord(strings.TrimRight(ch.ResolvedZone, "."), "TXT", _key)
|
||||||
|
|
||||||
if _id != "" {
|
if _id != "" {
|
||||||
err = c.freedns.DeleteRecord(_id)
|
err = c.freedns.DeleteRecord(_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user