aboutsummaryrefslogtreecommitdiffstats
path: root/routers/common/middleware.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-10-20 22:37:19 +0800
committerGitHub <noreply@github.com>2021-10-20 16:37:19 +0200
commitf494776931b71f83fdfdd4e68e850529c4b2614f (patch)
tree92b3779237dadfe042d3f93e9ddaaaac5d6d385f /routers/common/middleware.go
parent0208ea0248782a994771cadf0af6a4125fdde723 (diff)
downloadgitea-f494776931b71f83fdfdd4e68e850529c4b2614f.tar.gz
gitea-f494776931b71f83fdfdd4e68e850529c4b2614f.zip
Use a variable but a function for IsProd because of a slight performance increment (#17368)
Diffstat (limited to 'routers/common/middleware.go')
-rw-r--r--routers/common/middleware.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/common/middleware.go b/routers/common/middleware.go
index 1d96522dd9..7c5c72f5cc 100644
--- a/routers/common/middleware.go
+++ b/routers/common/middleware.go
@@ -62,7 +62,7 @@ func Middlewares() []func(http.Handler) http.Handler {
if err := recover(); err != nil {
combinedErr := fmt.Sprintf("PANIC: %v\n%s", err, string(log.Stack(2)))
log.Error("%v", combinedErr)
- if setting.IsProd() {
+ if setting.IsProd {
http.Error(resp, http.StatusText(500), 500)
} else {
http.Error(resp, combinedErr, 500)