mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-08-06 22:13:02 +02:00
Merge branch 'master' of https://github.com/EvgenKostenko/go-jira into EvgenKostenko-master
* 'master' of https://github.com/EvgenKostenko/go-jira: refactor project tests + go fmt add one more test for project service delete uncompleted boards add fmt dependency to jira.go get Authenticated reports session from main repository Add project and tests Implement workload in issue and Project list Change Coocke session get from request
This commit is contained in:
6
jira.go
6
jira.go
@ -23,6 +23,7 @@ type Client struct {
|
||||
// Services used for talking to different parts of the JIRA API.
|
||||
Authentication *AuthenticationService
|
||||
Issue *IssueService
|
||||
Project *ProjectService
|
||||
}
|
||||
|
||||
// NewClient returns a new JIRA API client.
|
||||
@ -48,6 +49,7 @@ func NewClient(httpClient *http.Client, baseURL string) (*Client, error) {
|
||||
}
|
||||
c.Authentication = &AuthenticationService{client: c}
|
||||
c.Issue = &IssueService{client: c}
|
||||
c.Project = &ProjectService{client: c}
|
||||
|
||||
return c, nil
|
||||
}
|
||||
@ -82,7 +84,9 @@ func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Requ
|
||||
|
||||
// Set session cookie if there is one
|
||||
if c.session != nil {
|
||||
req.Header.Set("Cookie", fmt.Sprintf("%s=%s", c.session.Session.Name, c.session.Session.Value))
|
||||
for _, cookie := range c.session.SetCoockie {
|
||||
req.AddCookie(cookie)
|
||||
}
|
||||
}
|
||||
|
||||
return req, nil
|
||||
|
Reference in New Issue
Block a user