mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2026-08-17 01:26:02 +00:00
in Upstream() call CheckIfOwnerExists to block requests for new users/orgs
This commit is contained in:
@@ -134,6 +134,12 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client, redi
|
||||
return true
|
||||
}
|
||||
|
||||
exists, _ := giteaClient.GiteaCheckIfOwnerExists(o.TargetOwner)
|
||||
if !exists {
|
||||
html.ReturnErrorPage(ctx, "forge client: new users/orgs are not allowed to use the old pages server. See https://codeberg.page on using git-pages", http.StatusBadRequest)
|
||||
return true
|
||||
}
|
||||
|
||||
// Check if the branch exists and when it was modified
|
||||
if o.BranchTimestamp.IsZero() {
|
||||
branchExist, err := o.GetBranchTimestamp(giteaClient)
|
||||
|
||||
Reference in New Issue
Block a user