mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
[#201] update required library, failing to populate cookiejar from cookies file
This commit is contained in:
Generated
+1
-1
@@ -39,7 +39,7 @@
|
||||
branch = "master"
|
||||
name = "github.com/coryb/oreo"
|
||||
packages = ["."]
|
||||
revision = "efd7a2135270bc44f64af39446c7226057e6953d"
|
||||
revision = "3e1b88fc08f134aa91ccfb5d58c983ca8ab42589"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/davecgh/go-spew"
|
||||
|
||||
+7
-4
@@ -182,11 +182,14 @@ func (c *Client) initCookieJar() (err error) {
|
||||
return err
|
||||
}
|
||||
for _, cookie := range cookies {
|
||||
url, err := url.Parse(cookie.Domain)
|
||||
if err != nil {
|
||||
return err
|
||||
// this is dumb, cookie.Domain *must not* have a scheme or port url.Parse will parse strings like "localhost"
|
||||
// into the Path variable, not Host. So lets just force Host. We also need to set arbitrary http/https Scheme
|
||||
// as Jar.SetCookies will ignore cookies where the url does not have a http/https Scheme
|
||||
u := &url.URL{
|
||||
Scheme: "http",
|
||||
Host: cookie.Domain,
|
||||
}
|
||||
c.Jar.SetCookies(url, []*http.Cookie{cookie})
|
||||
c.Jar.SetCookies(u, []*http.Cookie{cookie})
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user