From 13f3d940a28235b200fbd5c34b52b9587023dc2b Mon Sep 17 00:00:00 2001 From: Timothy Date: Thu, 6 Feb 2020 21:38:52 +0800 Subject: [PATCH] add IPv6 support for HE.net --- README.md | 1 + utils.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 55529cf..0d4c458 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ Usage of ./godns: Supported provider(s): * Cloudflare +* HE.net To enable the `IPv6` mode of GoDNS, you only need two steps: * Set the `ip_type` as `IPv6`, and make sure the `ipv6_url` is configured. diff --git a/utils.go b/utils.go index c229ac1..8ec6974 100644 --- a/utils.go +++ b/utils.go @@ -173,7 +173,7 @@ func GetIPOnline(configuration *Settings) (string, error) { var response *http.Response var err error - if configuration.IPType == "" || configuration.IPType == IPV4 { + if configuration.IPType == "" || strings.ToUpper(configuration.IPType) == IPV4 { response, err = client.Get(configuration.IPUrl) } else { response, err = client.Get(configuration.IPV6Url)