estately / rets

A pure-ruby library for fetching data from RETS servers
https://github.com/estately/rets
127 stars 94 forks source link

fix cookie saving with http-cookie #127

Closed hfaulds closed 9 years ago

hfaulds commented 9 years ago

Previously we called either HTTPClient.save_cookie_store or Webagent::CookieManager.save_all_cookies

HTTPClient:

def save_cookie_store
  @cookie_manager.save_cookies
end

https://github.com/nahi/httpclient/blob/b986cec52df1f2d6610a469f13f3778e81ba9dfa/lib/httpclient.rb#L580

Webagent::CookieManager def save_all_cookies(force = nil, save_unused = true, save_discarded = true) https://github.com/nahi/httpclient/blob/master/lib/httpclient/webagent-cookie.rb

Unfortunately save_all_cookies does not exist on HTTPClient::CookieManager (which we use because we include the http-cookie gem)

HTTPClient::CookieManager def save_cookies(session = false) https://github.com/nahi/httpclient/blob/master/lib/httpclient/cookie.rb#L25

There is no concept of force here but there is the option to save session cookies. To keep some kind of backward compatibility (and because estately want them) we will save session cookies. This can easily be put behind an option but there is no point adding one until some-one says they want it.

hfaulds commented 9 years ago

I'm going to wrap a test around this seeing as CI didn't pick it up.