From 9b8377cba90c4b3a28418c13eb414802e94af180 Mon Sep 17 00:00:00 2001 From: Neshura Date: Sun, 5 Jan 2025 21:57:44 +0100 Subject: [PATCH] Release 1.1.11: IP Fetch Hotifx --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3f9a72d..8445505 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -114,7 +114,7 @@ dependencies = [ [[package]] name = "cloudflare-dns-updater" -version = "1.1.10" +version = "1.1.11" dependencies = [ "chrono", "confy", diff --git a/Cargo.toml b/Cargo.toml index 33820b3..b3a098f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["Neshura"] name = "cloudflare-dns-updater" -version = "1.1.10" +version = "1.1.11" edition = "2021" description = "Application for automatically updating Cloudflare DNS records" license = "GPL-3.0-or-later" diff --git a/src/main.rs b/src/main.rs index 9bf43bf..e13904d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,8 +24,8 @@ struct Addresses { impl Addresses { fn new() -> Result> { let mut ret = Self { - ipv4_uri: "http://ip4only.me/api/".to_owned(), - ipv6_uri: "http://ip6only.me/api/".to_owned(), + ipv4_uri: "https://ipinfo.io/ip".to_owned(), + ipv6_uri: "https://v6.ipinfo.io/ip".to_owned(), ipv4: Ipv4Addr::new(0, 0, 0, 0), ipv6: Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0) }; @@ -122,7 +122,7 @@ impl Addresses { Ok(res) => { match res.status() { StatusCode::OK => { - let ip_string = res.text().expect("Returned data should always contain text").trim_end().split(',').collect::>()[1].to_owned(); + let ip_string = res.text().expect("Returned data should always contain text"); Ok(Ipv4Addr::from_str(ip_string.as_str()).expect("Returned IP should always be parseable")) }, _ => { @@ -145,7 +145,7 @@ impl Addresses { Ok(res) => { match res.status() { StatusCode::OK => { - let ip_string: String = res.text().expect("Returned data should always contain text").trim_end().split(',').collect::>()[1].to_owned(); + let ip_string: String = res.text().expect("Returned data should always contain text"); Ok(Ipv6Addr::from_str(ip_string.as_str()).expect("Returned IP should always be parseable")) }, _ => {