Record git repo URL in manifest for archive uploads with forge auth.

Resolves: https://codeberg.org/git-pages/git-pages/issues/165
This commit is contained in:
miyuko
2026-05-11 03:38:54 +01:00
parent 3311fb639d
commit ad92847fa0
4 changed files with 18 additions and 3 deletions
+5 -2
View File
@@ -523,19 +523,22 @@ func putPage(w http.ResponseWriter, r *http.Request) error {
result = UpdateFromRepository(ctx, webRoot, repoURL, branch)
default:
if auth, err := AuthorizeUpdateFromArchive(r); err != nil {
auth, err := AuthorizeUpdateFromArchive(r)
if err != nil {
return err
} else if auth.forgeUser != nil {
GetPrincipal(r.Context()).ForgeUser = auth.forgeUser
}
repoURL := auth.ForgeRepoURL()
if checkDryRun(w, r) {
return nil
}
// request body contains archive
reader := http.MaxBytesReader(w, r.Body, int64(config.Limits.MaxSiteSize.Bytes()))
result = UpdateFromArchive(ctx, webRoot, contentType, reader)
result = UpdateFromArchive(ctx, webRoot, repoURL, contentType, reader)
}
return reportUpdateResult(w, r, result)