-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade httpclient and include http-cookie #121
Conversation
load_cookies if @cookies_file | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole class is a stop-gap for nahi/httpclient#254.
I was a bit loathe to write our own cookie manager just to inject and expose the cookie jar (I'm a bit confused about what parts of HTTPClient rely on what cookie implementations as it seems like internally it uses WebAgent::Cookie some places).
This needs to also be a new version of the Gem as it changes dependencies. |
Did some testing against real rets servers. |
This also spams log output with
|
code looks fine. am I right that this would supersede #113? As long as you've tested it, I'm game to ship it. |
@hfaulds @dougcole Maybe we can combine efforts on this and #113 by merging our PRs together? I think both have ideas we can combine and we are stepping on each others toes at this point. I just pushed an update to #113 that cleans up the tests and uses For this, do you think it may be premature to override the cookie manager and expose the cookie jar? I see that this would make sense when #105 develops into something, but does not seem necessary at the moment. Also, may be good to have the dependency on |
Closing in favour of #113. Might end up with some of this logic if we write a custom cookie store but this goes beyond what it was supposed to. |
We discussed this in #113 and #105
To summarise. At the moment our
Rets::HttpClient#http_cookie
implementation assumes thehttpclient
is usingWebAgent::CookieManager
andWebAgent::Cookie
under the hood.If a project requires
httpclient
2.6 andhttp-cookie
then this breaks ashttpclient
loadsHttpClient::CookieManager
and a different cookie implementation.A couple quick fixes would be to:
Rets::HttpClient
http-cookie
and change outRets::HttpClient#http_cookie
Moving away from
WebAgent::CookieManager
is a step towards being able to store cookies in storage other than the filesystem (#105). It is more up to date with RFC and more flexible as well.Rets::CookieManager
exists to exposejar
publicly. I made a PR to httpclient so that in the future we should be able to avoid this: nahi/httpclient#254.This will also make it easy to provide a custom cookie jar implementation.