rack 2.2.14 → 2.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/rack/mock.rb +32 -3
- data/lib/rack/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d9e23c788790ba55d06e8e582e3b500110f79196afad3aad88d2212d97a89bd
|
4
|
+
data.tar.gz: 34fb7a71dc5f3ac49e9057ae8859abaea7a519f1db660cf47a8b1bb18a302186
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db69d179f624e29992d49360251a9693c24e2d5fa390db37b01fe2b33b9d200bcbb971434fda3e8c4b2e9920769330c89f16579f8bfe70f962ee299190925aa2
|
7
|
+
data.tar.gz: 5b5a6511914abc1eec5b5c7943ea3a7374fc6c7305258d2e62993b4b7217151eccd366bd38dba21082c12e2f4a288d353a53f50aa5b643d7bc8b7d580627b3e4
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file. For info on how to format all future additions to this file please reference [Keep A Changelog](https://keepachangelog.com/en/1.0.0/).
|
4
4
|
|
5
|
+
## [2.2.16] - 2025-05-22
|
6
|
+
|
7
|
+
- Fix incorrect backport of optional `CGI::Cookie` support. ([#2335](https://github.com/rack/rack/pull/2335), [@jeremyevans])
|
8
|
+
|
9
|
+
## [2.2.15] - 2025-05-18
|
10
|
+
|
11
|
+
- Optional support for `CGI::Cookie` if not available. ([#2327](https://github.com/rack/rack/pull/2327), [#2333](https://github.com/rack/rack/pull/2333), [@earlopain])
|
12
|
+
|
5
13
|
## [2.2.14] - 2025-05-06
|
6
14
|
|
7
15
|
### Security
|
@@ -777,3 +785,7 @@ Items below this line are from the previously maintained HISTORY.md and NEWS.md
|
|
777
785
|
- Removed Rails adapter, was too alpha.
|
778
786
|
|
779
787
|
## [0.1] 2007-03-03
|
788
|
+
|
789
|
+
[@ioquatix]: https://github.com/ioquatix "Samuel Williams"
|
790
|
+
[@jeremyevans]: https://github.com/jeremyevans "Jeremy Evans"
|
791
|
+
[@earlopain]: https://github.com/earlopain "Earlopain"
|
data/lib/rack/mock.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
require 'uri'
|
4
4
|
require 'stringio'
|
5
5
|
require_relative '../rack'
|
6
|
-
require 'cgi/cookie'
|
7
6
|
|
8
7
|
module Rack
|
9
8
|
# Rack::MockRequest helps testing your Rack application without
|
@@ -171,6 +170,36 @@ module Rack
|
|
171
170
|
# MockRequest.
|
172
171
|
|
173
172
|
class MockResponse < Rack::Response
|
173
|
+
begin
|
174
|
+
# Recent versions of the CGI gem may not provide `CGI::Cookie`.
|
175
|
+
require 'cgi/cookie'
|
176
|
+
Cookie = CGI::Cookie
|
177
|
+
rescue LoadError
|
178
|
+
class Cookie
|
179
|
+
attr_reader :name, :value, :path, :domain, :expires, :secure
|
180
|
+
|
181
|
+
def initialize(args)
|
182
|
+
@name = args["name"]
|
183
|
+
@value = args["value"]
|
184
|
+
@path = args["path"]
|
185
|
+
@domain = args["domain"]
|
186
|
+
@expires = args["expires"]
|
187
|
+
@secure = args["secure"]
|
188
|
+
end
|
189
|
+
|
190
|
+
def method_missing(method_name, *args, &block)
|
191
|
+
@value.send(method_name, *args, &block)
|
192
|
+
end
|
193
|
+
# :nocov:
|
194
|
+
ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
|
195
|
+
# :nocov:
|
196
|
+
|
197
|
+
def respond_to_missing?(method_name, include_all = false)
|
198
|
+
@value.respond_to?(method_name, include_all) || super
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
174
203
|
class << self
|
175
204
|
alias [] new
|
176
205
|
end
|
@@ -236,7 +265,7 @@ module Rack
|
|
236
265
|
set_cookie_header.split("\n").each do |cookie|
|
237
266
|
cookie_name, cookie_filling = cookie.split('=', 2)
|
238
267
|
cookie_attributes = identify_cookie_attributes cookie_filling
|
239
|
-
parsed_cookie =
|
268
|
+
parsed_cookie = Cookie.new(
|
240
269
|
'name' => cookie_name.strip,
|
241
270
|
'value' => cookie_attributes.fetch('value'),
|
242
271
|
'path' => cookie_attributes.fetch('path', nil),
|
@@ -253,7 +282,7 @@ module Rack
|
|
253
282
|
def identify_cookie_attributes(cookie_filling)
|
254
283
|
cookie_bits = cookie_filling.split(';')
|
255
284
|
cookie_attributes = Hash.new
|
256
|
-
cookie_attributes.store('value', cookie_bits[0].strip)
|
285
|
+
cookie_attributes.store('value', Array(cookie_bits[0].strip))
|
257
286
|
cookie_bits.each do |bit|
|
258
287
|
if bit.include? '='
|
259
288
|
cookie_attribute, attribute_value = bit.split('=')
|
data/lib/rack/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leah Neukirchen
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2025-05-
|
10
|
+
date: 2025-05-22 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: minitest
|
@@ -169,7 +168,6 @@ metadata:
|
|
169
168
|
changelog_uri: https://github.com/rack/rack/blob/master/CHANGELOG.md
|
170
169
|
documentation_uri: https://rubydoc.info/github/rack/rack
|
171
170
|
source_code_uri: https://github.com/rack/rack
|
172
|
-
post_install_message:
|
173
171
|
rdoc_options: []
|
174
172
|
require_paths:
|
175
173
|
- lib
|
@@ -184,8 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
182
|
- !ruby/object:Gem::Version
|
185
183
|
version: '0'
|
186
184
|
requirements: []
|
187
|
-
rubygems_version: 3.
|
188
|
-
signing_key:
|
185
|
+
rubygems_version: 3.6.2
|
189
186
|
specification_version: 4
|
190
187
|
summary: A modular Ruby webserver interface.
|
191
188
|
test_files: []
|