Skip to content

Commit

Permalink
Fix missing set-cookie issue.
Browse files Browse the repository at this point in the history
It appears newer versions of FreeIPA (>4.8.6) do not return the set-cookie
header in every response. It's only included in the initial login response.
Here we were updating the sessionID on every rpc call and erroring out if the
set-cookie header was missing. As this is not necessary we simply return if the
header is missing.
  • Loading branch information
aebruno committed Jul 15, 2020
1 parent 88618d7 commit a8eb83d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module github.com/ubccr/goipa

go 1.14

require (
github.com/go-ini/ini v1.37.0
github.com/hashicorp/go-uuid v0.0.0-20180228145832-27454136f036 // indirect
Expand Down
2 changes: 1 addition & 1 deletion ipa.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func (c *Client) setSessionID(res *http.Response) error {

cookie := res.Header.Get("Set-Cookie")
if len(cookie) == 0 {
return errors.New("empty set-cookie header")
return nil
}

ipaSession := ""
Expand Down

0 comments on commit a8eb83d

Please sign in to comment.