Commit graph

21 commits

Author SHA1 Message Date
Akinori MUSHA
c727d39076 Move cookies.txt parser and serializer from HTTP::CookieJar to HTTP::Cookie.
Fix a bug where anything after '#' in cookies.txt are removed.
2012-10-22 03:30:01 +09:00
Akinori MUSHA
95c702f99b Rename HTTP::CookieJar#add! to HTTP::CookieJar#add removing the original #add. 2012-10-22 02:39:20 +09:00
Akinori MUSHA
d2f31d90b5 HTTP::Cookie.new: Delay setting of origin. 2012-10-22 02:20:43 +09:00
Akinori MUSHA
ae4a9d8d40 Make HTTP::Cookie Comparable. 2012-10-22 01:02:00 +09:00
Akinori MUSHA
d59a0ee5ca Define a custom YAML encoder and decoder.
Drop support for deserializing YAML made with Mechanize <2.1.
2012-10-22 01:02:00 +09:00
Akinori MUSHA
aa64d3d98b Rename HTTP::Cookie#clear! to clear. 2012-10-21 23:48:57 +09:00
Akinori MUSHA
fe65dbfb89 Add HTTP::Cookie#domain_name. 2012-10-21 23:48:21 +09:00
Akinori MUSHA
232906e0c3 Remove obsolete instance variables. 2012-10-22 01:01:59 +09:00
Akinori MUSHA
39d6965ed9 Use String.try_convert if available. 2012-10-21 19:12:13 +09:00
Akinori MUSHA
dd3ca9a0f1 Inhibit a domain-less cookie from being used for checking validity. 2012-10-18 19:00:33 +09:00
Akinori MUSHA
c3e4fae60c Refer to the instance variable @domain instead of the accessor. 2012-10-18 18:59:37 +09:00
Akinori MUSHA
75f7ee6505 Make valid_for_uri? and acceptable_from_uri? accept a URL string also. 2012-10-18 18:57:46 +09:00
Akinori MUSHA
79ab0ffabf Oops, fix infinite recursive calls of URI(). 2012-10-18 18:40:39 +09:00
Akinori MUSHA
1a471513de Disallow changing the origin of a cookie once it is set. 2012-10-17 22:35:30 +09:00
Akinori MUSHA
532101a102 Introduce a new cookie object attribute "origin".
Change the signature of HTTP::Cookie.parse() so that it only
optionally takes an origin URI.  When one is given, the method checks
if each piece of cookie in the header value is valid and acceptable
from the origin to ignore unacceptable cookies.
2012-10-17 22:35:30 +09:00
Akinori MUSHA
a1e5e1628a Prepare for using URI(url_or_uri). 2012-10-17 22:35:28 +09:00
Akinori MUSHA
c23dafe8c3 Document that HTTP::Cookie.parse takes an optional block. 2012-10-17 22:35:08 +09:00
Akinori MUSHA
905cd2bc26 HTTP::Cookie.parse now returns an compacted array. 2012-10-17 22:34:29 +09:00
Akinori MUSHA
6110545ff9 Drop HTTP::Cookie#set_domain. 2012-10-17 22:30:07 +09:00
Akinori MUSHA
0cf86222f6 Booleanize the value if the key name is suffixed with a "?".
Neglect the "!" suffix that is not suitable for an attribute name
while at it.
2012-10-17 20:26:40 +09:00
Akinori MUSHA
060fc63c2a Import cookie related stuff from Mechanize. 2012-10-14 18:52:52 +09:00