Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion backend/cmd/server.go
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you confirm that this is not causing any lint error?.
the error was ignored to not showing lint error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes i already checked that

Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@

// CacheMiddleWare is Middleware for Caching purpose. It involves generating key for a request,
// authorizing user , store resource data in cache and returns data if key is present.
func CacheMiddleWare(c *HeadlampConfig) mux.MiddlewareFunc {

Check failure on line 186 in backend/cmd/server.go

View workflow job for this annotation

GitHub Actions / build

cognitive complexity 32 of func `CacheMiddleWare` is high (> 30) (gocognit)
return func(next http.Handler) http.Handler {
if !c.CacheEnabled {
return next
Expand Down Expand Up @@ -218,7 +218,9 @@

return
} else if !isAllowed && k8cache.IsAuthBypassURL(r.URL.Path) {
_ = k8cache.ReturnAuthErrorResponse(w, r, contextKey)
if err := k8cache.ReturnAuthErrorResponse(w, r, contextKey); err != nil {
c.handleError(w, ctx, span, err, "failed to return auth error response", http.StatusInternalServerError)
}

return
}
Expand Down
Loading