mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-19 04:33: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"
|
branch = "master"
|
||||||
name = "github.com/coryb/oreo"
|
name = "github.com/coryb/oreo"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "efd7a2135270bc44f64af39446c7226057e6953d"
|
revision = "3e1b88fc08f134aa91ccfb5d58c983ca8ab42589"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/davecgh/go-spew"
|
name = "github.com/davecgh/go-spew"
|
||||||
|
|||||||
+7
-4
@@ -182,11 +182,14 @@ func (c *Client) initCookieJar() (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, cookie := range cookies {
|
for _, cookie := range cookies {
|
||||||
url, err := url.Parse(cookie.Domain)
|
// this is dumb, cookie.Domain *must not* have a scheme or port url.Parse will parse strings like "localhost"
|
||||||
if err != nil {
|
// into the Path variable, not Host. So lets just force Host. We also need to set arbitrary http/https Scheme
|
||||||
return err
|
// 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
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user