Skip to content

Commit eeae063

Browse files
committed
rename
1 parent 4500686 commit eeae063

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

routers/common/blockexpensive.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func BlockExpensive() func(next http.Handler) http.Handler {
2222
return func(next http.Handler) http.Handler {
2323
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
2424
ret := determineRequestPriority(reqctx.FromContext(req.Context()))
25-
if !ret.SignIn {
25+
if !ret.SignedIn {
2626
if ret.Expensive || ret.LongPolling {
2727
http.Redirect(w, req, setting.AppSubURL+"/user/login", http.StatusSeeOther)
2828
return
@@ -74,14 +74,14 @@ func isRoutePathForLongPolling(routePattern string) bool {
7474
}
7575

7676
func determineRequestPriority(reqCtx reqctx.RequestContext) (ret struct {
77-
SignIn bool
77+
SignedIn bool
7878
Expensive bool
7979
LongPolling bool
8080
},
8181
) {
8282
chiRoutePath := chi.RouteContext(reqCtx).RoutePattern()
8383
if _, ok := reqCtx.GetData()[middleware.ContextDataKeySignedUser].(*user_model.User); ok {
84-
ret.SignIn = true
84+
ret.SignedIn = true
8585
} else {
8686
ret.Expensive = isRoutePathExpensive(chiRoutePath)
8787
ret.LongPolling = isRoutePathForLongPolling(chiRoutePath)

routers/common/blockexpensive_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
package common
55

66
import (
7-
"github.com/stretchr/testify/assert"
87
"testing"
8+
9+
"github.com/stretchr/testify/assert"
910
)
1011

1112
func TestBlockExpensive(t *testing.T) {

0 commit comments

Comments
 (0)