mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-08-17 09:26:04 +00:00
Allow a trailing dot in Codeberg Pages v2 DNS TXT authentication method.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user