summaryrefslogtreecommitdiffstats
path: root/modules/web/route.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-01-30 16:55:53 +0800
committerGitHub <noreply@github.com>2021-01-30 10:55:53 +0200
commit5e20fd6dbf52ede60ed9ac7944db0d3f6769cf86 (patch)
tree519259f05f7e7fc4dd1df4da521e000ce469567b /modules/web/route.go
parent0e0424c8ecaf6fa3cdd1fcfc154f188014c63dd8 (diff)
downloadgitea-5e20fd6dbf52ede60ed9ac7944db0d3f6769cf86.tar.gz
gitea-5e20fd6dbf52ede60ed9ac7944db0d3f6769cf86.zip
Move middlewares to web/middleware (#14480)
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'modules/web/route.go')
-rw-r--r--modules/web/route.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/web/route.go b/modules/web/route.go
index 701b3beed2..59e22c5be1 100644
--- a/modules/web/route.go
+++ b/modules/web/route.go
@@ -11,7 +11,7 @@ import (
"strings"
"code.gitea.io/gitea/modules/context"
- "code.gitea.io/gitea/modules/middlewares"
+ "code.gitea.io/gitea/modules/web/middleware"
"gitea.com/go-chi/binding"
"github.com/go-chi/chi"
@@ -120,17 +120,17 @@ func Bind(obj interface{}) http.HandlerFunc {
var theObj = reflect.New(tp).Interface() // create a new form obj for every request but not use obj directly
binding.Bind(ctx.Req, theObj)
SetForm(ctx, theObj)
- middlewares.AssignForm(theObj, ctx.Data)
+ middleware.AssignForm(theObj, ctx.Data)
})
}
// SetForm set the form object
-func SetForm(data middlewares.DataStore, obj interface{}) {
+func SetForm(data middleware.DataStore, obj interface{}) {
data.GetData()["__form"] = obj
}
// GetForm returns the validate form information
-func GetForm(data middlewares.DataStore) interface{} {
+func GetForm(data middleware.DataStore) interface{} {
return data.GetData()["__form"]
}