cookiejar 0.3.3 → 0.3.4

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
- SHA1:
3
- metadata.gz: 5aba395a725f02d0c68ab3f4b306af071ed2546e
4
- data.tar.gz: 138fc4cde85d20a2f820d94136aefec9465491f2
2
+ SHA256:
3
+ metadata.gz: d08d63f0ec86285b96e7ee8ba926564aa526b10ae9cb77e25bcd9acb8779600e
4
+ data.tar.gz: 6a5c0d291baab26ef76ef25d12c95d31b6ca6f47ada89d67e5aed5fa70582003
5
5
  SHA512:
6
- metadata.gz: 2b2866097c73852e924c2676f1fe71e5878832f282f9735b340789b9ee4fcf24f1031fe3cdce979be21e2f411dd268bc81fd7702d7ae75a17ea452579f7de08f
7
- data.tar.gz: 3d8f17b5d837b3ce5e0f00726875509589a9628b66b240deec90e17a899cdbcb3bfcd08565d16c3ac953759bd973dfb7bc6c75b2588927466a691c43f1fd32c7
6
+ metadata.gz: 2c23451da58eaffb6b878aa9bd21083de306461a88ea2381cb710d10fcd5cd99ee1d4227a26690c2407acc96528e61ce591738f0ce997c358a00e24cea96df06
7
+ data.tar.gz: c5029ccd84b21567f16750a24aca4d4c99f7c0078548451756027012753f001e8c92a7bdb6d520429e7a0a865302ba797ba5fa64b4b723416d644e134f6a98c9
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 - 2014, David Waite and Other Contributors
1
+ Copyright (c) 2009 - 2018, David Waite and Other Contributors
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
data/README.markdown CHANGED
@@ -7,6 +7,11 @@ Ruby CookieJar
7
7
 
8
8
  [![Build Status](https://travis-ci.org/dwaite/cookiejar.svg?branch=master)](https://travis-ci.org/dwaite/cookiejar)
9
9
 
10
+ Status
11
+ ------
12
+
13
+ This project is no longer maintained. There may be other gems more appropriate for use which support newer versions of the cookie specifications, or more maintained forks of this gem such as [cookiejar2](https://github.com/dorianmariefr/cookiejar2).
14
+
10
15
  Synopsis
11
16
  --------
12
17
 
data/_config.yml ADDED
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-tactile
data/cookiejar.gemspec CHANGED
@@ -8,6 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.name = 'cookiejar'
9
9
  s.version = CookieJar::VERSION
10
10
  s.authors = ['David Waite']
11
+ s.license = 'BSD-2-Clause'
11
12
  s.email = ['david@alkaline-solutions.com']
12
13
  s.description = 'Allows for parsing and returning cookies in Ruby HTTP client code'
13
14
  s.summary = 'Client-side HTTP Cookie library'
@@ -19,9 +20,9 @@ Gem::Specification.new do |s|
19
20
  s.rdoc_options = ['--title', 'CookieJar -- Client-side HTTP Cookies']
20
21
  s.require_paths = ['lib']
21
22
 
22
- s.add_development_dependency 'rake', '~> 10.0'
23
+ s.add_development_dependency 'rake', '>= 10.0'
23
24
  s.add_development_dependency 'rspec-collection_matchers', '~> 1.0'
24
25
  s.add_development_dependency 'rspec', '~> 3.0'
25
- s.add_development_dependency 'yard', '~> 0.8', '>= 0.8.7'
26
+ s.add_development_dependency 'yard', '~> 0.9.20'
26
27
  s.add_development_dependency 'bundler', '>= 0.9.3'
27
28
  end
@@ -180,7 +180,7 @@ module CookieJar
180
180
  '/'
181
181
  else
182
182
  uri.path
183
- end
183
+ end
184
184
  path_match = path.start_with? @path
185
185
  secure_match = !(@secure && uri.scheme == 'http')
186
186
  script_match = !(script && @http_only)
@@ -45,7 +45,7 @@ module CookieJar
45
45
  HDN = /\A#{PATTERN::HOSTNAME}\Z/
46
46
  TOKEN = /\A#{PATTERN::TOKEN}\Z/
47
47
  PARAM1 = /\A(#{PATTERN::TOKEN})(?:=#{PATTERN::VALUE1})?\Z/
48
- PARAM2 = Regexp.new "(#{PATTERN::TOKEN})(?:=(#{PATTERN::VALUE2}))?(?:\\Z|;)", '', 'n'
48
+ PARAM2 = Regexp.new("(#{PATTERN::TOKEN})(?:=(#{PATTERN::VALUE2}))?(?:\\Z|;)", Regexp::NOENCODING)
49
49
  # TWO_DOT_DOMAINS = /\A\.(com|edu|net|mil|gov|int|org)\Z/
50
50
 
51
51
  # Converts the input object to a URI (if not already a URI)
@@ -321,6 +321,8 @@ module CookieJar
321
321
  args[:secure] = true
322
322
  when :httponly
323
323
  args[:http_only] = true
324
+ when :samesite
325
+ args[:samesite] = keyvalue.downcase
324
326
  else
325
327
  fail InvalidCookieError, "Unknown cookie parameter '#{key}'"
326
328
  end
data/lib/cookiejar/jar.rb CHANGED
@@ -39,7 +39,7 @@ module CookieJar
39
39
  #
40
40
  # Paths are given a straight prefix string comparison to match.
41
41
  # Further filters <secure, http only, ports> are not represented in this
42
- # heirarchy.
42
+ # hierarchy.
43
43
  #
44
44
  # Cookies returned are ordered solely by specificity (length) of the
45
45
  # path.
@@ -222,7 +222,7 @@ module CookieJar
222
222
  '/'
223
223
  else
224
224
  uri.path
225
- end
225
+ end
226
226
 
227
227
  results = []
228
228
  hosts.each do |host|
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module CookieJar
3
- VERSION = '0.3.3'.freeze
3
+ VERSION = '0.3.4'.freeze
4
4
  end
data/spec/cookie_spec.rb CHANGED
@@ -65,10 +65,10 @@ describe Cookie do
65
65
  expect(cookie.secure).to be_truthy
66
66
  end
67
67
  it 'should fail on unquoted paths' do
68
- expect(lambda do
68
+ expect {
69
69
  Cookie.from_set_cookie2 'https://www.google.com/a/blah',
70
70
  'GALX=RgmSftjnbPM;Path=/a/;Secure;Version=1'
71
- end).to raise_error InvalidCookieError
71
+ }.to raise_error InvalidCookieError
72
72
  end
73
73
  it 'should accept quoted values' do
74
74
  cookie = Cookie.from_set_cookie2 'http://localhost/', 'foo="bar";Version=1'
@@ -5,46 +5,46 @@ describe CookieValidation do
5
5
  describe '#validate_cookie' do
6
6
  localaddr = 'http://localhost/foo/bar/'
7
7
  it 'should fail if version unset' do
8
- expect(lambda do
8
+ expect {
9
9
  unversioned = Cookie.from_set_cookie localaddr, 'foo=bar'
10
10
  unversioned.instance_variable_set :@version, nil
11
11
  CookieValidation.validate_cookie localaddr, unversioned
12
- end).to raise_error InvalidCookieError
12
+ }.to raise_error InvalidCookieError
13
13
  end
14
14
  it 'should fail if the path is more specific' do
15
- expect(lambda do
15
+ expect {
16
16
  Cookie.from_set_cookie localaddr, 'foo=bar;path=/foo/bar/baz'
17
- end).to raise_error InvalidCookieError
17
+ }.to raise_error InvalidCookieError
18
18
  end
19
19
  it 'should fail if the path is different than the request' do
20
- expect(lambda do
20
+ expect {
21
21
  Cookie.from_set_cookie localaddr, 'foo=bar;path=/baz/'
22
- end).to raise_error InvalidCookieError
22
+ }.to raise_error InvalidCookieError
23
23
  end
24
24
  it 'should fail if the domain has no dots' do
25
- expect(lambda do
25
+ expect {
26
26
  Cookie.from_set_cookie 'http://zero/', 'foo=bar;domain=zero'
27
- end).to raise_error InvalidCookieError
27
+ }.to raise_error InvalidCookieError
28
28
  end
29
29
  it 'should fail for explicit localhost' do
30
- expect(lambda do
30
+ expect {
31
31
  Cookie.from_set_cookie localaddr, 'foo=bar;domain=localhost'
32
- end).to raise_error InvalidCookieError
32
+ }.to raise_error InvalidCookieError
33
33
  end
34
34
  it 'should fail for mismatched domains' do
35
- expect(lambda do
35
+ expect {
36
36
  Cookie.from_set_cookie 'http://www.foo.com/', 'foo=bar;domain=bar.com'
37
- end).to raise_error InvalidCookieError
37
+ }.to raise_error InvalidCookieError
38
38
  end
39
39
  it 'should fail for domains more than one level up' do
40
- expect(lambda do
40
+ expect {
41
41
  Cookie.from_set_cookie 'http://x.y.z.com/', 'foo=bar;domain=z.com'
42
- end).to raise_error InvalidCookieError
42
+ }.to raise_error InvalidCookieError
43
43
  end
44
44
  it 'should fail for setting subdomain cookies' do
45
- expect(lambda do
45
+ expect {
46
46
  Cookie.from_set_cookie 'http://foo.com/', 'foo=bar;domain=auth.foo.com'
47
- end).to raise_error InvalidCookieError
47
+ }.to raise_error InvalidCookieError
48
48
  end
49
49
  it 'should handle a normal implicit internet cookie' do
50
50
  normal = Cookie.from_set_cookie 'http://foo.com/', 'foo=bar'
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookiejar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Waite
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2014-02-01 00:00:00.000000000 Z
@@ -14,14 +14,14 @@ dependencies:
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '10.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '10.0'
27
27
  - !ruby/object:Gem::Dependency
@@ -58,20 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.8'
62
- - - ">="
63
- - !ruby/object:Gem::Version
64
- version: 0.8.7
61
+ version: 0.9.20
65
62
  type: :development
66
63
  prerelease: false
67
64
  version_requirements: !ruby/object:Gem::Requirement
68
65
  requirements:
69
66
  - - "~>"
70
67
  - !ruby/object:Gem::Version
71
- version: '0.8'
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: 0.8.7
68
+ version: 0.9.20
75
69
  - !ruby/object:Gem::Dependency
76
70
  name: bundler
77
71
  requirement: !ruby/object:Gem::Requirement
@@ -100,6 +94,7 @@ files:
100
94
  - LICENSE
101
95
  - README.markdown
102
96
  - Rakefile
97
+ - _config.yml
103
98
  - contributors.json
104
99
  - cookiejar.gemspec
105
100
  - lib/cookiejar.rb
@@ -112,9 +107,10 @@ files:
112
107
  - spec/jar_spec.rb
113
108
  - spec/spec_helper.rb
114
109
  homepage: http://alkaline-solutions.com
115
- licenses: []
110
+ licenses:
111
+ - BSD-2-Clause
116
112
  metadata: {}
117
- post_install_message:
113
+ post_install_message:
118
114
  rdoc_options:
119
115
  - "--title"
120
116
  - CookieJar -- Client-side HTTP Cookies
@@ -131,9 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
127
  - !ruby/object:Gem::Version
132
128
  version: '0'
133
129
  requirements: []
134
- rubyforge_project:
135
- rubygems_version: 2.5.1
136
- signing_key:
130
+ rubygems_version: 3.5.3
131
+ signing_key:
137
132
  specification_version: 4
138
133
  summary: Client-side HTTP Cookie library
139
134
  test_files:
@@ -141,4 +136,3 @@ test_files:
141
136
  - spec/cookie_validation_spec.rb
142
137
  - spec/jar_spec.rb
143
138
  - spec/spec_helper.rb
144
- has_rdoc: