From 7fce7cf68bcc35cd5d054b0434d6943d77f7053a Mon Sep 17 00:00:00 2001 From: foehammer Date: Fri, 10 Feb 2023 01:44:44 +0000 Subject: [PATCH] Added Whitespace Trimming TXT DNS Records (#152) Solves https://codeberg.org/Codeberg/Community/issues/823 and https://codeberg.org/Codeberg/pages-server/issues/143 Co-authored-by: foehammer127 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/152 Reviewed-by: Otto Reviewed-by: Gusted Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: foehammer Co-committed-by: foehammer --- server/dns/dns.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/dns/dns.go b/server/dns/dns.go index 818e29a..2719d4d 100644 --- a/server/dns/dns.go +++ b/server/dns/dns.go @@ -28,7 +28,7 @@ func GetTargetFromDNS(domain, mainDomainSuffix string, dnsLookupCache cache.SetG names, err := net.LookupTXT(domain) if err == nil { for _, name := range names { - name = strings.TrimSuffix(name, ".") + name = strings.TrimSuffix(strings.TrimSpace(name), ".") if strings.HasSuffix(name, mainDomainSuffix) { cname = name break