1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-02-09 13:36:58 +02:00

Fixed typo in Cookies

This commit is contained in:
Andy Grunwald 2016-06-03 22:43:41 +02:00
parent 9b1bc58830
commit 077933ab00
2 changed files with 6 additions and 8 deletions

View File

@ -14,9 +14,9 @@ type AuthenticationService struct {
// Session represents a Session JSON response by the JIRA API.
type Session struct {
Self string `json:"self,omitempty"`
Name string `json:"name,omitempty"`
Session struct {
Self string `json:"self,omitempty"`
Name string `json:"name,omitempty"`
Session struct {
Name string `json:"name"`
Value string `json:"value"`
} `json:"session,omitempty"`
@ -26,7 +26,7 @@ type Session struct {
LastFailedLoginTime string `json:"lastFailedLoginTime"`
PreviousLoginTime string `json:"previousLoginTime"`
} `json:"loginInfo"`
SetCoockie []*http.Cookie
Cookies []*http.Cookie
}
// AcquireSessionCookie creates a new session for a user in JIRA.
@ -53,9 +53,7 @@ func (s *AuthenticationService) AcquireSessionCookie(username, password string)
session := new(Session)
resp, err := s.client.Do(req, session)
cookies := resp.Cookies()
session.SetCoockie = cookies
session.Cookies = resp.Cookies()
if err != nil {
return false, fmt.Errorf("Auth at JIRA instance failed (HTTP(S) request). %s", err)

View File

@ -84,7 +84,7 @@ func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Requ
// Set session cookie if there is one
if c.session != nil {
for _, cookie := range c.session.SetCoockie {
for _, cookie := range c.session.Cookies {
req.AddCookie(cookie)
}
}