mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-22 08:42:32 -05:00
Do not get count on /api routers
This commit is contained in:
parent
6069abe5fd
commit
341a3b571b
1 changed files with 5 additions and 0 deletions
|
@ -2,6 +2,7 @@ package user
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models"
|
"code.gitea.io/gitea/models"
|
||||||
"code.gitea.io/gitea/modules/base"
|
"code.gitea.io/gitea/modules/base"
|
||||||
|
@ -14,6 +15,10 @@ const (
|
||||||
|
|
||||||
// GetNotificationCount is the middleware that sets the notification count in the context
|
// GetNotificationCount is the middleware that sets the notification count in the context
|
||||||
func GetNotificationCount(c *context.Context) {
|
func GetNotificationCount(c *context.Context) {
|
||||||
|
if strings.HasPrefix(c.Req.URL.Path, "/api") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if !c.IsSigned {
|
if !c.IsSigned {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue