http-cookie 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e01904534ca62610f72b5aba64d20f403ef41334
4
- data.tar.gz: b7194473dbb2106fc6fea76fc8077135721518a3
3
+ metadata.gz: 633adcbc5625bcf9d8c1509b9480d955f3107a06
4
+ data.tar.gz: 17c8fefbe45bb8429d3c533a1338bf4cec02345e
5
5
  SHA512:
6
- metadata.gz: 11de16cdf76a561e3dfcf5af1fcc78d6231a352cba9460fed867b4a6a4548dd71b6615c75eb70507599f23906877c05e878b1ed1b5abb33ddcf3410cf5d2794e
7
- data.tar.gz: 9cd258c417a7f5f80a5b718a6f4c3b1a59086c871ae62500b3809fce95bbd57a75e45dd9d11deced0052996fa12e32769aae9f7547f82efbab4d1f1a4a2c68a7
6
+ metadata.gz: 190e3fc5a0a658b73a9fc6c0e43937b6fd9fdebb9b6d92e09edd51c24209fbd2fb61e9ea49eb29621f2fefeb1ec5095779deded65c343f2f0c52c4f53c1e0b76
7
+ data.tar.gz: 96627fd5e6617b71c0b5dadf08e918169aabeda0c9ebf0f3a3d1d3d4c920b3999637f61009f4d531ddb588178bd6f0e26529b9ee49bf1808374971b7337a69f3
@@ -2,7 +2,6 @@ language: ruby
2
2
  rvm:
3
3
  - 1.8.7
4
4
  - ree
5
- - 1.9.2
6
5
  - 1.9.3
7
6
  - 2.0.0
8
7
  - ruby-head
@@ -13,5 +12,6 @@ rvm:
13
12
  - rbx-19mode
14
13
  matrix:
15
14
  allow_failures:
15
+ - rvm: ruby-head
16
16
  - rvm: rbx-18mode
17
17
  - rvm: rbx-19mode
@@ -1,3 +1,9 @@
1
+ ## 1.0.2 (2013-09-10)
2
+
3
+ - Fix HTTP::Cookie.parse so that it does not raise ArgumentError
4
+ when it finds a bad name or value that is parsable but considered
5
+ invalid.
6
+
1
7
  ## 1.0.1 (2013-04-21)
2
8
 
3
9
  - Minor error handling improvements and documentation updates.
@@ -16,6 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.description = %q{HTTP::Cookie is a Ruby library to handle HTTP Cookies based on RFC 6265. It has with security, standards compliance and compatibility in mind, to behave just the same as today's major web browsers. It has builtin support for the legacy cookies.txt and the latest cookies.sqlite formats of Mozilla Firefox, and its modular API makes it easy to add support for a new backend store.}
17
17
  gem.summary = %q{A Ruby library to handle HTTP Cookies based on RFC 6265}
18
18
  gem.homepage = "https://github.com/sparklemotion/http-cookie"
19
+ gem.license = "MIT"
19
20
 
20
21
  gem.files = `git ls-files`.split($/)
21
22
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -281,7 +281,12 @@ class HTTP::Cookie
281
281
  Scanner.new(set_cookie, logger).scan_set_cookie { |name, value, attrs|
282
282
  break if name.nil? || name.empty?
283
283
 
284
- cookie = new(name, value)
284
+ begin
285
+ cookie = new(name, value)
286
+ rescue => e
287
+ logger.warn("Invalid name or value: #{e}") if logger
288
+ next
289
+ end
285
290
  cookie.created_at = created_at if created_at
286
291
  attrs.each { |aname, avalue|
287
292
  begin
@@ -1,5 +1,5 @@
1
1
  module HTTP
2
2
  class Cookie
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -16,7 +16,7 @@ class HTTP::CookieJar
16
16
  end
17
17
  begin
18
18
  require file
19
- rescue LoadError => e
19
+ rescue LoadError
20
20
  raise NameError, 'can\'t resolve constant %s; failed to load %s' % [name, file]
21
21
  end
22
22
  if const_defined?(name)
@@ -126,6 +126,22 @@ class TestHTTPCookie < Test::Unit::TestCase
126
126
  assert_equal 0, HTTP::Cookie.parse(cookie, url).size
127
127
  end
128
128
 
129
+ def test_parse_bad_name
130
+ cookie = "a\001b=c"
131
+ url = URI.parse('http://www.example.com/')
132
+ assert_nothing_raised {
133
+ assert_equal 0, HTTP::Cookie.parse(cookie, url).size
134
+ }
135
+ end
136
+
137
+ def test_parse_bad_value
138
+ cookie = "a=b\001c"
139
+ url = URI.parse('http://www.example.com/')
140
+ assert_nothing_raised {
141
+ assert_equal 0, HTTP::Cookie.parse(cookie, url).size
142
+ }
143
+ end
144
+
129
145
  def test_parse_weird_cookie
130
146
  cookie = 'n/a, ASPSESSIONIDCSRRQDQR=FBLDGHPBNDJCPCGNCPAENELB; path=/'
131
147
  url = URI.parse('http://www.searchinnovation.com/')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http-cookie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akinori MUSHA
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-04-21 00:00:00.000000000 Z
14
+ date: 2013-09-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: domain_name
@@ -153,7 +153,8 @@ files:
153
153
  - test/test_http_cookie.rb
154
154
  - test/test_http_cookie_jar.rb
155
155
  homepage: https://github.com/sparklemotion/http-cookie
156
- licenses: []
156
+ licenses:
157
+ - MIT
157
158
  metadata: {}
158
159
  post_install_message:
159
160
  rdoc_options: []