mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-08-17 09:26:04 +00:00
Update default index branch name for codeberg-pages-compat quirk.
The actual Codeberg Pages v2 server uses the Forgejo default branch for the index repository. The quirk previously used the `main` branch unconditionally. This is complex to implement, so per discussion with gusted we have decided to change the default branch to `pages` so that it has parity with non-Codeberg-specific behavior.
This commit is contained in:
+2
-3
@@ -315,17 +315,16 @@ func authorizeCodebergPagesV2(r *http.Request) (*Authorization, error) {
|
||||
if domainParts[0] == "page" && domainParts[1] == "codeberg" {
|
||||
// map of domain names to allowed repository and branch:
|
||||
// * {username}.codeberg.page =>
|
||||
// https://codeberg.org/{username}/pages.git#main
|
||||
// https://codeberg.org/{username}/pages.git#pages
|
||||
// * {reponame}.{username}.codeberg.page =>
|
||||
// https://codeberg.org/{username}/{reponame}.git#pages
|
||||
// * {branch}.{reponame}.{username}.codeberg.page =>
|
||||
// https://codeberg.org/{username}/{reponame}.git#{branch}
|
||||
username := domainParts[2]
|
||||
reponame := "pages"
|
||||
branch := "main"
|
||||
branch := "pages"
|
||||
if len(domainParts) >= 4 {
|
||||
reponame = domainParts[3]
|
||||
branch = "pages"
|
||||
}
|
||||
if len(domainParts) == 5 {
|
||||
branch = domainParts[4]
|
||||
|
||||
Reference in New Issue
Block a user