mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 14:26:58 +00:00
more string
This commit is contained in:
parent
662d76386c
commit
51ca74fc11
16 changed files with 121 additions and 123 deletions
|
@ -31,7 +31,7 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client) (fin
|
|||
branch := GetBranchTimestamp(giteaClient, o.TargetOwner, o.TargetRepo, o.TargetBranch)
|
||||
|
||||
if branch == nil {
|
||||
html.ReturnErrorPage(ctx, http.StatusFailedDependency)
|
||||
html.ReturnErrorPage(ctx, "", http.StatusFailedDependency)
|
||||
return true
|
||||
}
|
||||
o.TargetBranch = branch.Branch
|
||||
|
@ -39,7 +39,7 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client) (fin
|
|||
}
|
||||
|
||||
if o.TargetOwner == "" || o.TargetRepo == "" || o.TargetBranch == "" {
|
||||
html.ReturnErrorPage(ctx, http.StatusBadRequest)
|
||||
html.ReturnErrorPage(ctx, "", http.StatusBadRequest)
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client) (fin
|
|||
}
|
||||
if res != nil && (err != nil || res.StatusCode != http.StatusOK) {
|
||||
log.Printf("Couldn't fetch contents (status code %d): %v\n", res.StatusCode, err)
|
||||
html.ReturnErrorPage(ctx, http.StatusInternalServerError)
|
||||
html.ReturnErrorPage(ctx, "", http.StatusInternalServerError)
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client) (fin
|
|||
_, err := io.Copy(ctx.RespWriter, reader)
|
||||
if err != nil {
|
||||
log.Printf("Couldn't write body: %s\n", err)
|
||||
html.ReturnErrorPage(ctx, http.StatusInternalServerError)
|
||||
html.ReturnErrorPage(ctx, "", http.StatusInternalServerError)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue