diff options
Diffstat (limited to 'web/controllers/acmev2.go')
-rw-r--r-- | web/controllers/acmev2.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/web/controllers/acmev2.go b/web/controllers/acmev2.go index a2fadf5..7ea76af 100644 --- a/web/controllers/acmev2.go +++ b/web/controllers/acmev2.go | |||
@@ -42,16 +42,21 @@ func CreateAcmeChallengeV2(c *gin.Context) { | |||
42 | return | 42 | return |
43 | } | 43 | } |
44 | 44 | ||
45 | testFor := fmt.Sprintf("_acme-challenge.%s.%s", prefix, zone.Name) | ||
46 | if prefix == "" { | ||
47 | testFor = fmt.Sprintf("_acme-challenge.%s", zone.Name) | ||
48 | } | ||
49 | |||
45 | if err := cfg.DNSClient.WaitForDNSPropagation( | 50 | if err := cfg.DNSClient.WaitForDNSPropagation( |
46 | c.Request.Context(), | 51 | c.Request.Context(), |
47 | fmt.Sprintf("_acme-challenge.%s.", prefix), | 52 | testFor, |
48 | ch.Challenge, | 53 | ch.Challenge, |
49 | ); err != nil { | 54 | ); err != nil { |
50 | jsonError(c, http.StatusInternalServerError, fmt.Errorf("Error polling for DNS propagation: %w", err)) | 55 | jsonError(c, http.StatusInternalServerError, fmt.Errorf("Error polling for DNS propagation: %w", err)) |
51 | return | 56 | return |
52 | } | 57 | } |
53 | 58 | ||
54 | c.JSON(http.StatusCreated, "") | 59 | c.String(http.StatusCreated, "") |
55 | } | 60 | } |
56 | 61 | ||
57 | func DeleteAcmeChallengeV2(c *gin.Context) { | 62 | func DeleteAcmeChallengeV2(c *gin.Context) { |