1
0
Fork 0
forked from forgejo/forgejo

Rename context.Query to context.Form (#16562)

This commit is contained in:
Lunny Xiao 2021-07-29 09:42:15 +08:00 committed by GitHub
parent 3705168837
commit 33e0b38287
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
85 changed files with 393 additions and 396 deletions

View file

@ -1128,9 +1128,9 @@ func CompareAndPullRequestPost(ctx *context.Context) {
// TriggerTask response for a trigger task request
func TriggerTask(ctx *context.Context) {
pusherID := ctx.QueryInt64("pusher")
branch := ctx.Query("branch")
secret := ctx.Query("secret")
pusherID := ctx.FormInt64("pusher")
branch := ctx.Form("branch")
secret := ctx.Form("secret")
if len(branch) == 0 || len(secret) == 0 || pusherID <= 0 {
ctx.Error(http.StatusNotFound)
log.Trace("TriggerTask: branch or secret is empty, or pusher ID is not valid")
@ -1347,7 +1347,7 @@ func UpdatePullRequestTarget(ctx *context.Context) {
return
}
targetBranch := ctx.QueryTrim("target_branch")
targetBranch := ctx.FormTrim("target_branch")
if len(targetBranch) == 0 {
ctx.Error(http.StatusNoContent)
return