Closed uvlad7 closed 1 month ago
Thanks for adding this and agreed with approach would probably like more things to just be handled through the simpler set/get approach. Do you think it would be possible to add to this a test case?
add to this a test case
Sure, gonna take some time, though. Are you OK wit httpbin usage in the test?
httpbin looks interesting, but we have TestServlet already in the test_helper I assume for testing if cookies are set you could add a new endpoint:
def do_GET(req,res)
if req.path.match(/redirect$/)
res.status = 302
res['Location'] = '/foo'
elsif req.path.match(/not_here$/)
res.status = 404
elsif req.path.match(/error$/)
res.status = 500
end
respond_with("GET#{req.query_string}",req,res)
end
Maybe something like:
elsif req.path.match(/test_cookies/)
Added tests. Looks like tests/bug_issue277.rb
file is missing and was removed after rake package
.
Can you please release a new version after this is merged?
Thanks this is great !
@taf2 can you please release a new version?
Add interface to call
curl_easy_setopt
-Easy::setopt
- withCURLOPT_COOKIELIST
.It's not something like
#cookielist=
, because I believe this method should be more Rubyish, like add constants for special values, support array argument, or even useCURB_OBJECT_HSETTER
instead of simply passing it to libcurl and keep it consistent with other options (like you do this withheaders=
/CURLOPT_HTTPHEADER
, for example, and setenable_cookies
flag accordingly). All of this requires much more effort, and I'm happy with this simple raw interface.