Skip to content

Commit b5a5e1a

Browse files
committed
bugfix
1 parent a10afd9 commit b5a5e1a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

httpclient/client.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"fmt"
1212
"io"
1313
"net/http"
14+
"net/http/cookiejar"
1415
"net/url"
1516
"time"
1617

@@ -121,6 +122,13 @@ func (c *ClientConfig) Build() (*Client, error) {
121122

122123
httpClient := &prodClient{}
123124

125+
cookieJar, err := cookiejar.New(nil)
126+
if err != nil {
127+
return nil, err
128+
}
129+
130+
httpClient.SetCookieJar(cookieJar)
131+
124132
if c.CustomRedirectPolicy != nil {
125133
httpClient.SetRedirectPolicy(c.CustomRedirectPolicy)
126134
}

httpclient/cookies.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
package httpclient
22

33
import (
4-
"net/http/cookiejar"
54
"net/url"
65
)
76

87
// loadCustomCookies applies the custom cookies supplied in the config and applies them to the http session.
98
func (c *Client) loadCustomCookies() error {
109
c.Sugar.Debug("initilizing cookie jar")
1110

12-
cookieJar, err := cookiejar.New(nil)
13-
if err != nil {
14-
return err
15-
}
16-
17-
c.http.SetCookieJar(cookieJar)
18-
1911
cookieUrl, err := url.Parse((*c.Integration).GetFQDN())
2012
c.Sugar.Debug("cookie URL set globally to: %s", cookieUrl)
2113
if err != nil {

0 commit comments

Comments
 (0)