aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/packages
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-07-21 06:43:49 +0800
committerGitHub <noreply@github.com>2023-07-21 00:43:49 +0200
commit9b25bfa8f4b6faf1b9799629db485c7d0e77ccd6 (patch)
treef6392c9938ae6b69fe454f9281dd192ce3fb3116 /routers/api/packages
parentd12ba978a70fab41aac47c2e16a48d0d8f82a17e (diff)
downloadgitea-9b25bfa8f4b6faf1b9799629db485c7d0e77ccd6.tar.gz
gitea-9b25bfa8f4b6faf1b9799629db485c7d0e77ccd6.zip
Remove redundant "RouteMethods" method (#26024)
The `RouteMethods` is mainly an alias for `Methods` with different argument order. Remove it to keep the "route.go" code clear
Diffstat (limited to 'routers/api/packages')
-rw-r--r--routers/api/packages/api.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/packages/api.go b/routers/api/packages/api.go
index fa7f66f3ab..2ba35e2138 100644
--- a/routers/api/packages/api.go
+++ b/routers/api/packages/api.go
@@ -634,7 +634,7 @@ func ContainerRoutes() *web.Route {
)
// Manual mapping of routes because {image} can contain slashes which chi does not support
- r.RouteMethods("/*", "HEAD,GET,POST,PUT,PATCH,DELETE", func(ctx *context.Context) {
+ r.Methods("HEAD,GET,POST,PUT,PATCH,DELETE", "/*", func(ctx *context.Context) {
path := ctx.Params("*")
isHead := ctx.Req.Method == "HEAD"
isGet := ctx.Req.Method == "GET"