Skip to content

Commit

Permalink
test: if context is missing create a new one
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandroMiceli committed May 11, 2021
1 parent 3403410 commit eaedd2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions http/middleware/response_header.go
Expand Up @@ -10,7 +10,6 @@ import (
"sync"

"github.com/pace/bricks/http/oauth2"
"github.com/pace/bricks/maintenance/log"
)

// ClientIDHeaderName name of the HTTP header that is used for reporting
Expand All @@ -34,8 +33,9 @@ func AddResponseClientID(ctx context.Context) {
clientID, _ := oauth2.ClientID(ctx)
cIDc := ResponseClientIDContextFromContext(ctx)
if cIDc == nil {
log.Ctx(ctx).Warn().Msgf("can't add client %s, because context is missing", clientID)
return
//log.Ctx(ctx).Warn().Msgf("can't add client %s, because context is missing", clientID)
cIDc = &ResponseClientIDContext{}
//return
}
cIDc.AddResponseClientID(clientID)
}
Expand Down

0 comments on commit eaedd2b

Please sign in to comment.