outposts/proxy: fix error checking for type assertion
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -15,7 +15,11 @@ func (a *Application) handleRedirect(rw http.ResponseWriter, r *http.Request) {
|
||||
if err != nil {
|
||||
s.Values[constants.SessionOAuthState] = []string{}
|
||||
}
|
||||
state := s.Values[constants.SessionOAuthState].([]string)
|
||||
state, ok := s.Values[constants.SessionOAuthState].([]string)
|
||||
if !ok {
|
||||
s.Values[constants.SessionOAuthState] = []string{}
|
||||
state = []string{}
|
||||
}
|
||||
s.Values[constants.SessionOAuthState] = append(state, newState)
|
||||
err = s.Save(r, rw)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user