Skip to content

Commit

Permalink
Merge pull request #1043 from replicatedhq/divolgin/logs
Browse files Browse the repository at this point in the history
don't error log when session is not found
  • Loading branch information
divolgin committed Aug 28, 2020
2 parents f881ac8 + 1e137fa commit 82d61e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kotsadm/pkg/handlers/middleware.go
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/pkg/errors"
"github.com/replicatedhq/kots/kotsadm/pkg/logger"
"github.com/replicatedhq/kots/kotsadm/pkg/store"
)

func CorsMiddleware(next http.Handler) http.Handler {
Expand All @@ -19,7 +20,9 @@ func CorsMiddleware(next http.Handler) http.Handler {
func RequireValidSessionMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if err := requireValidSession(w, r); err != nil {
logger.Error(errors.Wrapf(err, "request %q", r.RequestURI))
if !store.GetStore().IsNotFound(err) {
logger.Error(errors.Wrapf(err, "request %q", r.RequestURI))
}
return
}
next.ServeHTTP(w, r)
Expand Down

0 comments on commit 82d61e4

Please sign in to comment.