mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-11-18 10:29:43 +00:00
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 <foehammer127@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/152 Reviewed-by: Otto <otto@codeberg.org> Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: foehammer <foehammer@noreply.codeberg.org> Co-committed-by: foehammer <foehammer@noreply.codeberg.org>
This commit is contained in:
parent
8b1f497bc4
commit
7fce7cf68b
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ func GetTargetFromDNS(domain, mainDomainSuffix string, dnsLookupCache cache.SetG
|
||||||
names, err := net.LookupTXT(domain)
|
names, err := net.LookupTXT(domain)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
for _, name := range names {
|
for _, name := range names {
|
||||||
name = strings.TrimSuffix(name, ".")
|
name = strings.TrimSuffix(strings.TrimSpace(name), ".")
|
||||||
if strings.HasSuffix(name, mainDomainSuffix) {
|
if strings.HasSuffix(name, mainDomainSuffix) {
|
||||||
cname = name
|
cname = name
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue