rack 3.0.16 → 3.0.18
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 +17 -0
- data/lib/rack/mock_response.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: c109b92a92a0fcc346c4fabc30223e1a29fec8d062f91c45791d4b2a4b411a2f
|
4
|
+
data.tar.gz: 161c23b7fcfecad716e387db0946f07ceab0c5ff8616cc5c022ec8fafd097382
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eb41a9d006fba6cdb3c272c74527896a6a3b5c9dc0b855a5ca06928ec50d182edfb23c6cf777ce77995d0d2f41a74440e59a48a301e12e1f99f5ca98cfda694
|
7
|
+
data.tar.gz: 865ae1620806ea268231ce88b4b228d6bef477e37cd465dd8525d81c42fdd5eab0a75f3de21770a6209d25ed9e2a49be4cacbf5335e356af73cd831bbb64dd37
|
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
|
+
## [3.0.18] - 2025-05-22
|
6
|
+
|
7
|
+
- Fix incorrect backport of optional `CGI::Cookie` support. ([#2335](https://github.com/rack/rack/pull/2335), [@jeremyevans])
|
8
|
+
|
9
|
+
## [3.0.17] - 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
|
## [3.0.16] - 2025-05-06
|
6
14
|
|
7
15
|
### Security
|
@@ -210,6 +218,14 @@ All notable changes to this project will be documented in this file. For info on
|
|
210
218
|
- Fix multipart filename generation for filenames that contain spaces. Encode spaces as "%20" instead of "+" which will be decoded properly by the multipart parser. ([#1736](https://github.com/rack/rack/pull/1645), [@muirdm](https://github.com/muirdm))
|
211
219
|
- `Rack::Request#scheme` returns `ws` or `wss` when one of the `X-Forwarded-Scheme` / `X-Forwarded-Proto` headers is set to `ws` or `wss`, respectively. ([#1730](https://github.com/rack/rack/issues/1730), [@erwanst](https://github.com/erwanst))
|
212
220
|
|
221
|
+
## [2.2.16] - 2025-05-22
|
222
|
+
|
223
|
+
- Fix incorrect backport of optional `CGI::Cookie` support. ([#2335](https://github.com/rack/rack/pull/2335), [@jeremyevans])
|
224
|
+
|
225
|
+
## [2.2.15] - 2025-05-18
|
226
|
+
|
227
|
+
- 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])
|
228
|
+
|
213
229
|
## [2.2.14] - 2025-05-06
|
214
230
|
|
215
231
|
### Security
|
@@ -994,3 +1010,4 @@ Items below this line are from the previously maintained HISTORY.md and NEWS.md
|
|
994
1010
|
[@amatsuda]: https://github.com/amatsuda "Akira Matsuda"
|
995
1011
|
[@wjordan]: https://github.com/wjordan "Will Jordan"
|
996
1012
|
[@BlakeWilliams]: https://github.com/BlakeWilliams "Blake Williams"
|
1013
|
+
[@earlopain]: https://github.com/earlopain "Earlopain"
|
data/lib/rack/mock_response.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'cgi/cookie'
|
4
3
|
require 'time'
|
5
4
|
|
6
5
|
require_relative 'response'
|
@@ -11,6 +10,36 @@ module Rack
|
|
11
10
|
# MockRequest.
|
12
11
|
|
13
12
|
class MockResponse < Rack::Response
|
13
|
+
begin
|
14
|
+
# Recent versions of the CGI gem may not provide `CGI::Cookie`.
|
15
|
+
require 'cgi/cookie'
|
16
|
+
Cookie = CGI::Cookie
|
17
|
+
rescue LoadError
|
18
|
+
class Cookie
|
19
|
+
attr_reader :name, :value, :path, :domain, :expires, :secure
|
20
|
+
|
21
|
+
def initialize(args)
|
22
|
+
@name = args["name"]
|
23
|
+
@value = args["value"]
|
24
|
+
@path = args["path"]
|
25
|
+
@domain = args["domain"]
|
26
|
+
@expires = args["expires"]
|
27
|
+
@secure = args["secure"]
|
28
|
+
end
|
29
|
+
|
30
|
+
def method_missing(method_name, *args, &block)
|
31
|
+
@value.send(method_name, *args, &block)
|
32
|
+
end
|
33
|
+
# :nocov:
|
34
|
+
ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
|
35
|
+
# :nocov:
|
36
|
+
|
37
|
+
def respond_to_missing?(method_name, include_all = false)
|
38
|
+
@value.respond_to?(method_name, include_all) || super
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
14
43
|
class << self
|
15
44
|
alias [] new
|
16
45
|
end
|
@@ -84,7 +113,7 @@ module Rack
|
|
84
113
|
header_value.split("\n").each do |cookie|
|
85
114
|
cookie_name, cookie_filling = cookie.split('=', 2)
|
86
115
|
cookie_attributes = identify_cookie_attributes cookie_filling
|
87
|
-
parsed_cookie =
|
116
|
+
parsed_cookie = Cookie.new(
|
88
117
|
'name' => cookie_name.strip,
|
89
118
|
'value' => cookie_attributes.fetch('value'),
|
90
119
|
'path' => cookie_attributes.fetch('path', nil),
|
@@ -102,7 +131,7 @@ module Rack
|
|
102
131
|
def identify_cookie_attributes(cookie_filling)
|
103
132
|
cookie_bits = cookie_filling.split(';')
|
104
133
|
cookie_attributes = Hash.new
|
105
|
-
cookie_attributes.store('value', cookie_bits[0].strip)
|
134
|
+
cookie_attributes.store('value', Array(cookie_bits[0].strip))
|
106
135
|
cookie_bits.drop(1).each do |bit|
|
107
136
|
if bit.include? '='
|
108
137
|
cookie_attribute, attribute_value = bit.split('=', 2)
|
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: 3.0.
|
4
|
+
version: 3.0.18
|
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
|
@@ -149,7 +148,6 @@ metadata:
|
|
149
148
|
changelog_uri: https://github.com/rack/rack/blob/main/CHANGELOG.md
|
150
149
|
documentation_uri: https://rubydoc.info/github/rack/rack
|
151
150
|
source_code_uri: https://github.com/rack/rack
|
152
|
-
post_install_message:
|
153
151
|
rdoc_options: []
|
154
152
|
require_paths:
|
155
153
|
- lib
|
@@ -164,8 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
162
|
- !ruby/object:Gem::Version
|
165
163
|
version: '0'
|
166
164
|
requirements: []
|
167
|
-
rubygems_version: 3.
|
168
|
-
signing_key:
|
165
|
+
rubygems_version: 3.6.2
|
169
166
|
specification_version: 4
|
170
167
|
summary: A modular Ruby webserver interface.
|
171
168
|
test_files: []
|