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 +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +6 -0
- data/http-cookie.gemspec +1 -0
- data/lib/http/cookie.rb +6 -1
- data/lib/http/cookie/version.rb +1 -1
- data/lib/http/cookie_jar.rb +1 -1
- data/test/test_http_cookie.rb +16 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 633adcbc5625bcf9d8c1509b9480d955f3107a06
|
4
|
+
data.tar.gz: 17c8fefbe45bb8429d3c533a1338bf4cec02345e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 190e3fc5a0a658b73a9fc6c0e43937b6fd9fdebb9b6d92e09edd51c24209fbd2fb61e9ea49eb29621f2fefeb1ec5095779deded65c343f2f0c52c4f53c1e0b76
|
7
|
+
data.tar.gz: 96627fd5e6617b71c0b5dadf08e918169aabeda0c9ebf0f3a3d1d3d4c920b3999637f61009f4d531ddb588178bd6f0e26529b9ee49bf1808374971b7337a69f3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/http-cookie.gemspec
CHANGED
@@ -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) }
|
data/lib/http/cookie.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/http/cookie/version.rb
CHANGED
data/lib/http/cookie_jar.rb
CHANGED
data/test/test_http_cookie.rb
CHANGED
@@ -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.
|
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-
|
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: []
|