summaryrefslogtreecommitdiffstats
path: root/routers/routes
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 /routers/routes
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 'routers/routes')
-rw-r--r--routers/routes/base.go4
-rw-r--r--routers/routes/install.go4
-rw-r--r--routers/routes/web.go2
3 files changed, 5 insertions, 5 deletions
diff --git a/routers/routes/base.go b/routers/routes/base.go
index 4efb7f01d5..12a35936b1 100644
--- a/routers/routes/base.go
+++ b/routers/routes/base.go
@@ -18,10 +18,10 @@ import (
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/httpcache"
"code.gitea.io/gitea/modules/log"
- "code.gitea.io/gitea/modules/middlewares"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
"code.gitea.io/gitea/modules/templates"
+ "code.gitea.io/gitea/modules/web/middleware"
"gitea.com/go-chi/session"
)
@@ -153,7 +153,7 @@ func Recovery() func(next http.Handler) http.Handler {
return
}
- var lc = middlewares.Locale(w, req)
+ var lc = middleware.Locale(w, req)
var store = dataStore{
Data: templates.Vars{
"Language": lc.Language(),
diff --git a/routers/routes/install.go b/routers/routes/install.go
index 0dc066d600..fea396bc26 100644
--- a/routers/routes/install.go
+++ b/routers/routes/install.go
@@ -11,11 +11,11 @@ import (
"code.gitea.io/gitea/modules/forms"
"code.gitea.io/gitea/modules/log"
- "code.gitea.io/gitea/modules/middlewares"
"code.gitea.io/gitea/modules/public"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/templates"
"code.gitea.io/gitea/modules/web"
+ "code.gitea.io/gitea/modules/web/middleware"
"code.gitea.io/gitea/routers"
"gitea.com/go-chi/session"
@@ -46,7 +46,7 @@ func installRecovery() func(next http.Handler) http.Handler {
combinedErr := fmt.Sprintf("PANIC: %v\n%s", err, string(log.Stack(2)))
log.Error("%v", combinedErr)
- lc := middlewares.Locale(w, req)
+ lc := middleware.Locale(w, req)
var store = dataStore{
Data: templates.Vars{
"Language": lc.Language(),
diff --git a/routers/routes/web.go b/routers/routes/web.go
index 03555e3d54..f2b68aa10a 100644
--- a/routers/routes/web.go
+++ b/routers/routes/web.go
@@ -247,7 +247,7 @@ func RegisterRoutes(m *web.Route) {
}
}
- // FIXME: not all routes need go through same middlewares.
+ // FIXME: not all routes need go through same middleware.
// Especially some AJAX requests, we can reduce middleware number to improve performance.
// Routers.
// for health check