diff --git a/Gopkg.lock b/Gopkg.lock index 3c1a58f..25a9fbe 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -39,7 +39,7 @@ branch = "master" name = "github.com/coryb/oreo" packages = ["."] - revision = "efd7a2135270bc44f64af39446c7226057e6953d" + revision = "3e1b88fc08f134aa91ccfb5d58c983ca8ab42589" [[projects]] name = "github.com/davecgh/go-spew" diff --git a/vendor/github.com/coryb/oreo/oreo.go b/vendor/github.com/coryb/oreo/oreo.go index 4848632..6bc368a 100644 --- a/vendor/github.com/coryb/oreo/oreo.go +++ b/vendor/github.com/coryb/oreo/oreo.go @@ -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 }