From 15107298b20e6081d3ef40955b206f9336152f8f Mon Sep 17 00:00:00 2001 From: Catherine Date: Tue, 7 Oct 2025 19:00:46 +0000 Subject: [PATCH] Allow a trailing dot in Codeberg Pages v2 DNS TXT authentication method. --- src/auth.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/auth.go b/src/auth.go index 2119a28..3c59434 100644 --- a/src/auth.go +++ b/src/auth.go @@ -271,6 +271,9 @@ func authorizeCodebergPagesV2(r *http.Request) (*Authorization, error) { for _, dnsRecord := range dnsRecords { domainParts := strings.Split(dnsRecord, ".") slices.Reverse(domainParts) + if domainParts[0] == "" { + domainParts = domainParts[1:] + } if len(domainParts) >= 3 && len(domainParts) <= 5 { if domainParts[0] == "page" && domainParts[1] == "codeberg" { // map of domain names to allowed repository and branch: