@@ -50,6 +50,7 @@ func (p *Provider) listRecords(ctx context.Context, zone string) ([]libdns.Recor
5050 Name : txRecord .Name ,
5151 Value : txRecord .Value ,
5252 TTL : time .Duration (txRecord .TTL ) * time .Second ,
53+ MX : txRecord .MX ,
5354 }
5455 libdnsRecord , err := rr .libdnsRecord ()
5556 if err != nil {
@@ -177,15 +178,20 @@ func (p *Provider) findRecord(ctx context.Context, zone string, record libdns.Re
177178}
178179
179180func (p * Provider ) sendRequest (ctx context.Context , action string , data string ) ([]byte , error ) {
180- req , err := http .NewRequestWithContext (ctx , "POST" , endpoint , strings .NewReader (data ))
181+ endpointUrl := endpoint
182+ if p .Region != "" {
183+ endpointUrl = "https://dnspod." + p .Region + ".tencentcloudapi.com"
184+ }
185+
186+ req , err := http .NewRequestWithContext (ctx , "POST" , endpointUrl , strings .NewReader (data ))
181187 if err != nil {
182188 return nil , err
183189 }
184190
185191 req .Header .Set ("Content-Type" , "application/json" )
186192 req .Header .Set ("X-TC-Version" , "2021-03-23" )
187193
188- SignRequest (p .SecretId , p .SecretKey , req , action , data )
194+ SignRequest (p .SecretId , p .SecretKey , p . SessionToken , req , action , data )
189195 resp , err := http .DefaultClient .Do (req )
190196 if err != nil {
191197 return nil , err
0 commit comments