Skip to content

Commit

Permalink
Chore: address CR
Browse files Browse the repository at this point in the history
  • Loading branch information
till committed Jun 23, 2022
1 parent d6c0511 commit bcb5dea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pipeline/authn/authenticator_cookie_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,13 @@ func forwardRequestToSessionStore(r *http.Request, checkSessionURL string, prese
logger.Tracef("Error reading response from remote: %v", err)
return json.RawMessage{}, errors.WithStack(herodot.ErrInternalServerError.WithReasonf("Unable to read response from remote: %s", err))
}
defer res.Body.Close()

if res.StatusCode == 200 {
return body, nil
}

logger.Tracef("Remote returned non-200 status code '%d' with body: %s", res.StatusCode, body)
logger.WithField("response_code", res.StatusCode).WithField("body", string(body)).Trace()

return json.RawMessage{}, errors.WithStack(helper.ErrUnauthorized.WithReasonf("Remote returned non 200 status code: %d", res.StatusCode))
}

0 comments on commit bcb5dea

Please sign in to comment.