mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-05-13 21:56:42 +02:00
Fixed typo in Cookies
This commit is contained in:
parent
9b1bc58830
commit
077933ab00
@ -14,9 +14,9 @@ type AuthenticationService struct {
|
|||||||
|
|
||||||
// Session represents a Session JSON response by the JIRA API.
|
// Session represents a Session JSON response by the JIRA API.
|
||||||
type Session struct {
|
type Session struct {
|
||||||
Self string `json:"self,omitempty"`
|
Self string `json:"self,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Session struct {
|
Session struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Value string `json:"value"`
|
Value string `json:"value"`
|
||||||
} `json:"session,omitempty"`
|
} `json:"session,omitempty"`
|
||||||
@ -26,7 +26,7 @@ type Session struct {
|
|||||||
LastFailedLoginTime string `json:"lastFailedLoginTime"`
|
LastFailedLoginTime string `json:"lastFailedLoginTime"`
|
||||||
PreviousLoginTime string `json:"previousLoginTime"`
|
PreviousLoginTime string `json:"previousLoginTime"`
|
||||||
} `json:"loginInfo"`
|
} `json:"loginInfo"`
|
||||||
SetCoockie []*http.Cookie
|
Cookies []*http.Cookie
|
||||||
}
|
}
|
||||||
|
|
||||||
// AcquireSessionCookie creates a new session for a user in JIRA.
|
// AcquireSessionCookie creates a new session for a user in JIRA.
|
||||||
@ -53,9 +53,7 @@ func (s *AuthenticationService) AcquireSessionCookie(username, password string)
|
|||||||
|
|
||||||
session := new(Session)
|
session := new(Session)
|
||||||
resp, err := s.client.Do(req, session)
|
resp, err := s.client.Do(req, session)
|
||||||
|
session.Cookies = resp.Cookies()
|
||||||
cookies := resp.Cookies()
|
|
||||||
session.SetCoockie = cookies
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, fmt.Errorf("Auth at JIRA instance failed (HTTP(S) request). %s", err)
|
return false, fmt.Errorf("Auth at JIRA instance failed (HTTP(S) request). %s", err)
|
||||||
|
2
jira.go
2
jira.go
@ -84,7 +84,7 @@ func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Requ
|
|||||||
|
|
||||||
// Set session cookie if there is one
|
// Set session cookie if there is one
|
||||||
if c.session != nil {
|
if c.session != nil {
|
||||||
for _, cookie := range c.session.SetCoockie {
|
for _, cookie := range c.session.Cookies {
|
||||||
req.AddCookie(cookie)
|
req.AddCookie(cookie)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user