diff options
author | Andrey Nering <andrey.nering@gmail.com> | 2017-01-02 16:31:50 -0200 |
---|---|---|
committer | Andrey Nering <andrey.nering@gmail.com> | 2017-01-02 16:31:50 -0200 |
commit | 341a3b571bd262d7dc758825ca4dddca4e7f832b (patch) | |
tree | 3d002be25469f373e6df1a9e90927f63a1d793e9 | |
parent | 6069abe5fdf49cbd9a80c9df0c136587fc8601b5 (diff) | |
download | gitea-341a3b571bd262d7dc758825ca4dddca4e7f832b.tar.gz gitea-341a3b571bd262d7dc758825ca4dddca4e7f832b.zip |
Do not get count on /api routers
-rw-r--r-- | routers/user/notification.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/user/notification.go b/routers/user/notification.go index 13d2d70f8e..866cc6de02 100644 --- a/routers/user/notification.go +++ b/routers/user/notification.go @@ -2,6 +2,7 @@ package user import ( "fmt" + "strings" "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/base" @@ -14,6 +15,10 @@ const ( // GetNotificationCount is the middleware that sets the notification count in the context func GetNotificationCount(c *context.Context) { + if strings.HasPrefix(c.Req.URL.Path, "/api") { + return + } + if !c.IsSigned { return } |