aboutsummaryrefslogtreecommitdiffstats
path: root/routers/private
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-07-29 09:42:15 +0800
committerGitHub <noreply@github.com>2021-07-29 03:42:15 +0200
commit33e0b38287fdc3487112062300b8dd3c95415ee7 (patch)
tree603394d8f303de1031c21da0d3d3a3cdc0b2bfda /routers/private
parent370516883717de0e6e2087c12d368eb1465ee3b0 (diff)
downloadgitea-33e0b38287fdc3487112062300b8dd3c95415ee7.tar.gz
gitea-33e0b38287fdc3487112062300b8dd3c95415ee7.zip
Rename context.Query to context.Form (#16562)
Diffstat (limited to 'routers/private')
-rw-r--r--routers/private/key.go2
-rw-r--r--routers/private/serv.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/routers/private/key.go b/routers/private/key.go
index 2bb319083f..1e60af232a 100644
--- a/routers/private/key.go
+++ b/routers/private/key.go
@@ -50,7 +50,7 @@ func UpdatePublicKeyInRepo(ctx *context.PrivateContext) {
// AuthorizedPublicKeyByContent searches content as prefix (leak e-mail part)
// and returns public key found.
func AuthorizedPublicKeyByContent(ctx *context.PrivateContext) {
- content := ctx.Query("content")
+ content := ctx.Form("content")
publicKey, err := models.SearchPublicKeyByContent(content)
if err != nil {
diff --git a/routers/private/serv.go b/routers/private/serv.go
index f80d16a7f8..aae2a87229 100644
--- a/routers/private/serv.go
+++ b/routers/private/serv.go
@@ -77,7 +77,7 @@ func ServCommand(ctx *context.PrivateContext) {
keyID := ctx.ParamsInt64(":keyid")
ownerName := ctx.Params(":owner")
repoName := ctx.Params(":repo")
- mode := models.AccessMode(ctx.QueryInt("mode"))
+ mode := models.AccessMode(ctx.FormInt("mode"))
// Set the basic parts of the results to return
results := private.ServCommandResults{
@@ -127,7 +127,7 @@ func ServCommand(ctx *context.PrivateContext) {
if err != nil {
if models.IsErrRepoNotExist(err) {
repoExist = false
- for _, verb := range ctx.QueryStrings("verb") {
+ for _, verb := range ctx.FormStrings("verb") {
if "git-upload-pack" == verb {
// User is fetching/cloning a non-existent repository
log.Error("Failed authentication attempt (cannot find repository: %s/%s) from %s", results.OwnerName, results.RepoName, ctx.RemoteAddr())