From 341a3b571bd262d7dc758825ca4dddca4e7f832b Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Mon, 2 Jan 2017 16:31:50 -0200 Subject: [PATCH] Do not get count on /api routers --- routers/user/notification.go | 5 +++++ 1 file changed, 5 insertions(+) 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 }