Skip to content

Commit

Permalink
Fix coprocess auth when session set and token empty
Browse files Browse the repository at this point in the history
Check if token is empty. Fix
#1739
  • Loading branch information
buger committed May 28, 2018
1 parent 9fa81e1 commit baccdcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion coprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func (m *CoProcessMiddleware) ProcessRequest(w http.ResponseWriter, r *http.Requ
// Is this a CP authentication middleware?
if m.Spec.EnableCoProcessAuth && m.HookType == coprocess.HookType_CustomKeyCheck {
// The CP middleware didn't setup a session:
if returnObject.Session == nil {
if returnObject.Session == nil || token == "" {
authHeaderValue := r.Header.Get(m.Spec.Auth.AuthHeaderName)
AuthFailed(m, r, authHeaderValue)
return errors.New("Key not authorised"), 403
Expand Down

0 comments on commit baccdcf

Please sign in to comment.