diff options
author | Alex Auvolat <alex@adnab.me> | 2022-12-11 16:42:00 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-12-11 16:42:00 +0100 |
commit | 2e3442faa9625f706b4131417381d8fd2fb3bda3 (patch) | |
tree | 7a757c029c0dd00005c7e0eb59fb46df55fc3aa1 /src/provider/gandi.rs | |
parent | b26d4d7bbad7c77f466a00f0bd21e7e4ea09c3b1 (diff) | |
download | D53-2e3442faa9625f706b4131417381d8fd2fb3bda3.tar.gz D53-2e3442faa9625f706b4131417381d8fd2fb3bda3.zip |
Fix subdomain matching
Diffstat (limited to 'src/provider/gandi.rs')
-rw-r--r-- | src/provider/gandi.rs | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/provider/gandi.rs b/src/provider/gandi.rs index eeff641..0658db2 100644 --- a/src/provider/gandi.rs +++ b/src/provider/gandi.rs @@ -56,10 +56,16 @@ impl DnsProvider for GandiProvider { "gandi" } - async fn update_a(&self, domain: &str, subdomain: &str, targets: &[Ipv4Addr]) -> Result<()> { + async fn update_a( + &self, + domain: &str, + subdomain: Option<&str>, + targets: &[Ipv4Addr], + ) -> Result<()> { let url = format!( "https://api.gandi.net/v5/livedns/domains/{}/records/{}/A", - domain, subdomain + domain, + subdomain.unwrap_or("@") ); let rrset = GandiRrset { @@ -70,10 +76,16 @@ impl DnsProvider for GandiProvider { self.put_rrset(&url, &rrset).await } - async fn update_aaaa(&self, domain: &str, subdomain: &str, targets: &[Ipv6Addr]) -> Result<()> { + async fn update_aaaa( + &self, + domain: &str, + subdomain: Option<&str>, + targets: &[Ipv6Addr], + ) -> Result<()> { let url = format!( "https://api.gandi.net/v5/livedns/domains/{}/records/{}/AAAA", - domain, subdomain + domain, + subdomain.unwrap_or("@") ); let rrset = GandiRrset { @@ -84,10 +96,16 @@ impl DnsProvider for GandiProvider { self.put_rrset(&url, &rrset).await } - async fn update_cname(&self, domain: &str, subdomain: &str, target: &str) -> Result<()> { + async fn update_cname( + &self, + domain: &str, + subdomain: Option<&str>, + target: &str, + ) -> Result<()> { let url = format!( "https://api.gandi.net/v5/livedns/domains/{}/records/{}/CNAME", - domain, subdomain + domain, + subdomain.unwrap_or("@") ); let rrset = GandiRrset { |