Skip to content

Commit 1e177a1

Browse files
committed
review
1 parent 36afa97 commit 1e177a1

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

providers/dns/yandex360/internal/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func NewClient(oauthToken string, orgID int64) (*Client, error) {
5050
func (c Client) AddRecord(ctx context.Context, domain string, record Record) (*Record, error) {
5151
endpoint := c.baseURL.JoinPath("directory", "v1", "org", strconv.FormatInt(c.orgID, 10), "domains", domain, "dns")
5252

53-
req, err := newJSONRequest(ctx, http.MethodGet, endpoint, record)
53+
req, err := newJSONRequest(ctx, http.MethodPost, endpoint, record)
5454
if err != nil {
5555
return nil, err
5656
}

providers/dns/yandex360/internal/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func setupTest(t *testing.T, pattern, method string, status int, filename string
5454
}
5555

5656
func TestClient_AddRecord(t *testing.T) {
57-
client := setupTest(t, "/directory/v1/org/123456/domains/example.com/dns", http.MethodGet, http.StatusOK, "add-record.json")
57+
client := setupTest(t, "/directory/v1/org/123456/domains/example.com/dns", http.MethodPost, http.StatusOK, "add-record.json")
5858

5959
record := Record{
6060
Name: "_acme-challenge",

providers/dns/yandex360/yandex360.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
9494
client.HTTPClient = config.HTTPClient
9595
}
9696

97-
return &DNSProvider{client: client, config: config}, nil
97+
return &DNSProvider{
98+
client: client,
99+
config: config,
100+
recordIDs: make(map[string]int64),
101+
}, nil
98102
}
99103

100104
// Present creates a TXT record to fulfill the dns-01 challenge.

0 commit comments

Comments
 (0)