Commit graph

185 commits

Author SHA1 Message Date
Akinori MUSHA
823c2a15e0 Add sqlite3 as runtime dependency, or MozillaStore. 2013-03-27 16:01:48 +09:00
Akinori MUSHA
69b3186666 Add MozillaStore. 2013-03-27 16:01:48 +09:00
Akinori MUSHA
bea9b1b502 each, cleanup: Fix the base date for expiration when the method starts.
This change is to remove an assumption that the clock is monotonic.
2013-03-27 15:10:03 +09:00
Akinori MUSHA
299bb24550 add(): Stop deleting an existing cookie when storing an expired cookie.
This is a backout of what I've done previously.  Expiration check is
better done in extraction where a user can optionally specify a base
date.

Add an internal method delete() to delete an existing cookie.
2013-03-27 14:58:22 +09:00
Akinori MUSHA
bd3ae6c1ae CookiestxtSaver: Hide HttpOnly cookies from old browsers.
This trick is the one that has been used in Mozilla before switching
the cookie database to SQLite.
2013-03-26 15:37:50 +09:00
Akinori MUSHA
8b78e3d1e4 CookiestxtSaver: Prefix the domain field with a dot if the domain flag is on.
The leading dot itself should be meaningless since there is the second
field to tell if the cookie is issued for a domain and that was the
reason I once removed it, but on second thought it doesn't hurt to put
one.
2013-03-26 15:37:50 +09:00
Akinori MUSHA
f2ea366de2 Add HTTP::Cookie#dot_domain. 2013-03-26 01:48:27 +09:00
Akinori MUSHA
f5bc5032dd No need to check validity here any more. 2013-03-26 01:43:19 +09:00
Akinori MUSHA
51da5e4c50 Do not touch and yield a cookie that should not be sent. 2013-03-26 01:43:06 +09:00
Akinori MUSHA
30920cae9c Bump VERSION to 1.0.0.pre2. 2013-03-23 02:03:17 +09:00
Akinori MUSHA
5b78957e19 Conform to RFC 6265 5.1.4 in that path=/a matches /a/* but not /ab.
Remove HTTP::Cookie.normalize_path and add HTTP::Cookie.path_match?
instead for comparison.
2013-03-23 02:02:56 +09:00
Akinori MUSHA
4cbea79c00 Improve tests for valid_for_uri?. 2013-03-23 01:54:58 +09:00
Akinori MUSHA
d47e2fe8ad Add tests for #path. 2013-03-23 01:39:46 +09:00
Akinori MUSHA
6dda359db1 Improve rdoc. 2013-03-23 00:37:21 +09:00
Akinori MUSHA
38f7e98f09 Replace compatibility errors with documentation.
Leave compatibility stuff to Mechanize itself and just keep
http-cookie clean.
2013-03-23 00:27:38 +09:00
Akinori MUSHA
ba3ea4cd33 Bump the version number high up to 1.0.0.pre1. 2013-03-21 17:56:08 +09:00
Akinori MUSHA
96dabc8288 Add 1.8 compatibility. 2013-03-21 17:31:05 +09:00
Akinori MUSHA
c442e8e0c8 The compatibility method clear! does not need to take arguments. 2013-03-21 17:30:25 +09:00
Akinori MUSHA
ddf74fee1e Rewrite the Set-Cookie header parser entirely.
The new parser is almost RFC 6265 compliant as the previous
implementation but has some extensions:

- It can parse double-quoted values with unsafe characters inside
  escaped with the backslash.

- It parses a date value of the expires attribute in the way the RFC
  describes, with an exception that it allows omission of the seconds
  field.  Some of the broken date representations that used to pass
  are now treated as error and ignored.

- It can parse a Set-Cookie value that contains multiple cookie
  definitions separated by comma, and commas put inside double quotes
  are not mistaken as definition separator.
2013-03-21 15:52:22 +09:00
Akinori MUSHA
b11aa95025 Initialize secure and httponly with false instead of nil. 2013-03-21 15:49:44 +09:00
Akinori MUSHA
6b6944b324 Add inspect. 2013-03-21 15:46:45 +09:00
Akinori MUSHA
66f37b20dd Rename expire to expire!, to reduce the risk of making a typo. 2013-03-21 15:46:45 +09:00
Akinori MUSHA
f04714741f Add expires_at as alias for expires. 2013-03-21 15:46:45 +09:00
Akinori MUSHA
ae0b3834e7 Make path= accept a string-like. 2013-03-21 15:46:45 +09:00
Akinori MUSHA
59370c79c3 Improve rdoc markups, migrating to Markdown. 2013-03-21 15:46:45 +09:00
Akinori MUSHA
5d0bc5f67d Disallow some more bad characters in name=/value=. 2013-03-21 15:46:45 +09:00
Akinori MUSHA
cc6780a5bc A relative path must be treated as the root path as per RFC 6265 5.1.4. 2013-03-21 15:46:45 +09:00
Akinori MUSHA
28eabedcd3 Use __send__() instead of send(). 2013-03-21 15:46:45 +09:00
Akinori MUSHA
b78271db6d Remove an obsolete part. 2013-03-21 15:46:45 +09:00
Akinori MUSHA
f14c1786cd Make expires and max_age affect each other and drop session=(). 2013-03-21 15:46:45 +09:00
Akinori MUSHA
1c7b660c85 Improve comments. 2013-03-21 15:46:45 +09:00
Akinori MUSHA
ceea67add9 Drop multi-byte characters from the test, which are not allowed. 2013-03-21 15:46:45 +09:00
Akinori MUSHA
7d81c10914 A cookie value may be DQUOTE'd as per RFC 6265 2.2.
Escaping with the backslash character is not mentioned in the RFC but
the backslash character is not allowed here anyway, so just be nice
and support it for legacy applications.
2013-03-21 15:46:45 +09:00
Akinori MUSHA
6c5e87aff3 Add ruby-head and jruby-head. 2013-03-18 02:04:25 +09:00
Akinori MUSHA
4532f190cc Avoid 1.9 syntax. 2013-03-18 01:05:03 +09:00
Akinori MUSHA
af97e2db0f Add rake and rdoc as development dependency. 2013-03-18 01:00:55 +09:00
Akinori MUSHA
ca51ab9430 Add .travis.yml. 2013-03-18 00:56:47 +09:00
Akinori MUSHA
1eb25f4ab9 Bump VERSION to 0.1.5. 2013-03-18 00:53:14 +09:00
Akinori MUSHA
dff0f57614 Delete trailing whitespace. 2013-03-18 00:43:52 +09:00
Akinori MUSHA
1a7c38e9e0 Apply minor code improvements. 2013-03-18 00:40:47 +09:00
Akinori MUSHA
9768154e82 Dir.tmpdir should be mktmpdir here. 2013-03-18 00:39:55 +09:00
Akinori MUSHA
c389a52e2c Drop dependency on WEBrick::HTTPUtils. 2013-03-18 00:09:01 +09:00
Akinori MUSHA
6d3f4ee2dd parse() ignores bad cookies. 2013-03-18 00:06:20 +09:00
Akinori MUSHA
4a5eb9801a Test that parse() actually returns a cookie. 2013-03-18 00:05:31 +09:00
Akinori MUSHA
3e61ef78a2 Require 'uri'. 2013-03-17 23:56:58 +09:00
Akinori MUSHA
cbb25195d4 Bump VERSION to 0.1.4. 2013-03-15 19:25:16 +09:00
Akinori MUSHA
fc8ddebce0 Fix a terrible typo that kept YAMLServer from working. :( 2013-03-15 19:24:20 +09:00
Akinori MUSHA
c6d28de9b7 Improve documentation. 2013-03-15 19:22:39 +09:00
Akinori MUSHA
c99825de21 Cookie.parse() returns an array of cookies. 2013-03-15 18:35:13 +09:00
Akinori MUSHA
d2cb5ff69d Bump VERSION to 0.1.3. 2013-03-15 12:31:49 +09:00