Commit graph

221 commits

Author SHA1 Message Date
Luke Hill
d2890896e7
Update cookie.rb to handle situations when expires is a DateTime object
The standard Selenium WebDriver response is to return an object which has an expiry in datetime format.

In order to most effectively work with Selenium, and to provide the smallest barrier possible, co-erce the DateTime object into a Time object and then store it as a HTTP Cookie
2024-12-02 17:41:53 +00:00
Mike Dalessio
9efa5792ba
version bump to v1.0.7 2024-06-06 15:33:41 -04:00
Mike Dalessio
69b240bc01
fix: explicitly require CGI
Closes #49
2024-06-06 11:11:17 -04:00
Akinori MUSHA
b2019f9c10 Bump VERSION to 1.0.6 2024-06-01 11:51:42 +09:00
Mike Dalessio
22ea7af086
fix: be explicit about frozen string literals to quash warnings 2024-03-24 10:02:56 -04:00
Akinori Musha
94e2b85861
Merge pull request #42 from andrelaszlo/abstract_store_fix_error_formatting_bug
Fix error formatting bug in HTTP::CookieJar::AbstractStore
2023-11-13 23:02:13 +09:00
Akinori MUSHA
8930674adf Change the custom URI parser to be a bit more conservative
First try the default URI(), and if it fails relax the restrictions on
the path component as a fallback.
2023-11-02 01:48:31 +09:00
Christian Schmidt
27cc46c1d7 URI.for is not supported on old rubies 2023-10-13 07:19:11 +02:00
Christian Schmidt
052479536c Allow non-RFC 3986-compliant URLs 2023-10-12 18:34:07 +02:00
André Laszlo
44374a7517 Fix an error formatting bug 2023-02-13 18:24:47 +01:00
Akinori MUSHA
b1202f959e Bump VERSION to 1.0.5 2022-05-25 17:14:50 +09:00
Akinori MUSHA
060eb44497 Avoid use of numeric indexing on SQLite3::ResultSet::HashWithTypesAndFields 2022-05-25 15:37:48 +09:00
Akinori MUSHA
2c220f44dd Allow aliases because YAML.dump generates aliases when it sees multiple occurrences of an object 2021-06-07 14:45:58 +09:00
Akinori MUSHA
7a1bf4fbb3 Use safe_load when using Psych >=3.1 2021-06-07 13:41:45 +09:00
Akinori MUSHA
9eb68dcce5 Merge pull request #14 from wrzasa/master
More informative error message when cannot load a store (rebased on current master)
2016-12-09 21:52:51 +09:00
Akinori MUSHA
24b5d407d9 Merge pull request #10 from marxarelli/fix/host-only-cookie-domain-comparison
Fix host-only cookies for unqualified hostnames
2016-12-09 21:48:59 +09:00
Akinori MUSHA
80e855fdf2 Merge branch 'fix_time_representation' 2016-12-09 21:43:47 +09:00
Akinori MUSHA
56e0fd5175 Add 1.8 compatibility 2016-12-09 21:38:35 +09:00
Akinori MUSHA
9f5a0d65da MozillaStore: creationTime and lastAccessed are in usec, not seconds
This was pointed out by #8.  I decided not to add extra code for
backwards compatibility of their values.
2016-12-09 21:12:32 +09:00
Akinori MUSHA
5d7fbde318 Avoid warnings 2016-12-08 23:49:44 +09:00
Akinori MUSHA
40d988ab92 Set the originAttributes column when inserting a record 2016-12-08 23:42:40 +09:00
Akinori MUSHA
930d8242cf Bump VERSION to 1.0.4 2016-11-25 01:54:53 +09:00
Akinori MUSHA
67630ac6be Support Mozilla's cookie storage format up to version 7 2016-11-25 01:52:52 +09:00
Akinori MUSHA
f4a18a76ca Bump VERSION to 1.0.3 2016-09-30 20:01:40 +09:00
Akinori MUSHA
7f94a9e5d9 Treat comma as normal character in HTTP::Cookie.cookie_value_to_hash
As pointed out in CVE-2016-7401, treating comma in a Cookie header value
as separator may cause security problems.
2016-09-30 19:20:39 +09:00
wrzasa
f828cf0319 More informative error message when cannot load a store
I tried to use `mozilla` store, but got the following message, that gave me no clue what's wrong:

          ArgumentError: cookie store unavailable: :mozilla

After some debugging I found that I have no `sqlite3` gem installed. But the error message should tell mi that. 

This change should help.
2016-03-18 17:24:56 +01:00
Dan Duvall
69154b11dd Fix host-only cookies for unqualified hostnames
Removed comparison against `DomainName#cookie_domain?` during filtering
of jar cookies. It was redundant considering the later call to
`HTTP::Cookie#valid_for_url?` and prevented valid host-only cookies from
being considered for unqualified hostnames (e.g. "localhost").

RFC 6265 (5.4) does not restrict host-only cookies from being used with
such unqualified names as it does for cookies with the domain attribute
set.
2015-09-02 12:57:11 -07:00
Akinori MUSHA
d3d4f0dafe Bump VERSION 1.0.2. 2013-09-10 14:52:55 +09:00
Akinori MUSHA
391ada20d0 HTTP::Cookie.parse() should not raise an exception if it finds a bad name or value. 2013-09-10 14:48:29 +09:00
Lee Jarvis
5319f88dc2 fix unused variable warning in LoadError rescue 2013-05-25 10:17:13 +01:00
Akinori MUSHA
b934db8e77 Bump VERSION to 1.0.1 and add CHANGELOG.md. 2013-04-21 21:46:31 +09:00
Akinori MUSHA
40aba54618 Accept a class object where a symbol addressing a class is accepted.
Convert IndexError to ArgumentError, and ArgumentError to TypeError as
appropriate.
2013-04-21 20:35:17 +09:00
Akinori MUSHA
17d5a128d7 Fix error messages. 2013-04-21 19:32:57 +09:00
Akinori MUSHA
1dd16745e3 Update a comment. 2013-04-21 19:28:12 +09:00
Akinori MUSHA
3d4f0a65ff Cookie#origin=: Add a comment to explain why @origin is set the last. 2013-04-18 22:23:30 +09:00
Akinori MUSHA
a0202e2192 Cookie#max_age= should not reset #expires when it fails. 2013-04-18 22:22:11 +09:00
Akinori MUSHA
640ea1b297 Omit calling #expires= when #max_age= is going to be called. 2013-04-18 21:42:22 +09:00
Akinori MUSHA
d2eb1289f5 Bump VERSION to 1.0.0. 2013-04-17 10:28:17 +09:00
Akinori MUSHA
892c07024d Add rdoc markups. 2013-04-17 01:14:45 +09:00
Akinori MUSHA
a1cfe6bb70 Remove unused code. 2013-04-17 01:14:22 +09:00
Akinori MUSHA
0d5e666642 Improve rdoc. 2013-04-16 22:37:19 +09:00
Akinori MUSHA
bf9bbe3da8 Move Array#sort_by! to http/cookie/ruby_compat. 2013-04-16 22:15:29 +09:00
Akinori MUSHA
bafb83fc06 Let AbstractStore & AbstractSaver autoloaded and add tests for autoloading. 2013-04-16 16:49:27 +09:00
Akinori MUSHA
04950f6796 Cookie#new: Reject a mixed case symbol as keyword for simplicity.
This fixes error with Ruby 1.8.
2013-04-16 16:39:55 +09:00
Akinori MUSHA
a3ab578671 Fix *Store#empty?. 2013-04-16 15:05:00 +09:00
Akinori MUSHA
2bb7485460 Add tests for CookieJar#clone, #cleanup, expiration by #each and #empty?. 2013-04-16 15:05:00 +09:00
Akinori MUSHA
5bdb8f41ae Cookie#new prefers downcased symbols for keywords.
Test warnings.
2013-04-16 08:44:48 +09:00
Akinori MUSHA
c293005676 Bump VERSION to 1.0.0.pre12. 2013-04-16 02:44:26 +09:00
Akinori MUSHA
8ae076d9ea Fix the compatibility code to support Syck. 2013-04-16 01:39:09 +09:00
Akinori MUSHA
fcdaddcbe6 Emit a proper message when try_convert() fails. 2013-04-16 01:38:05 +09:00