rack 3.0.16 → 3.0.17
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 +9 -0
- data/lib/rack/mock_response.rb +31 -2
- data/lib/rack/version.rb +1 -1
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3edf21b75cf99b2e46bdeca610592537a1bf049ca57602943af9d7f8bd446666
|
4
|
+
data.tar.gz: 2619cfe2fd66de38a387978af8db591635402a66c841b532dc52abe841058454
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd6d0fdc1d2f981c38ae3c1a0a84c126b440d39394d9ec18c5c5ed07770efe01c95d0c6a64a195b2ad4bd5d4d900e1eff08872fd972cb979aec8429331cabc40
|
7
|
+
data.tar.gz: 61b44c13230df6379b8c760d2e7e5c6756f7b42a2f81d14c2cc21cf94eefa781d7e4b53d8f411fc724fef5b987959d791463cef4aa42a9a5e2c480b7470b8e1d
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
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.17] - 2025-05-18
|
6
|
+
|
7
|
+
- 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])
|
8
|
+
|
5
9
|
## [3.0.16] - 2025-05-06
|
6
10
|
|
7
11
|
### Security
|
@@ -210,6 +214,10 @@ All notable changes to this project will be documented in this file. For info on
|
|
210
214
|
- 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
215
|
- `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
216
|
|
217
|
+
## [2.2.15] - 2025-05-18
|
218
|
+
|
219
|
+
- 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])
|
220
|
+
|
213
221
|
## [2.2.14] - 2025-05-06
|
214
222
|
|
215
223
|
### Security
|
@@ -994,3 +1002,4 @@ Items below this line are from the previously maintained HISTORY.md and NEWS.md
|
|
994
1002
|
[@amatsuda]: https://github.com/amatsuda "Akira Matsuda"
|
995
1003
|
[@wjordan]: https://github.com/wjordan "Will Jordan"
|
996
1004
|
[@BlakeWilliams]: https://github.com/BlakeWilliams "Blake Williams"
|
1005
|
+
[@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),
|
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.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leah Neukirchen
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: minitest
|
@@ -76,9 +75,9 @@ email: leah@vuxu.org
|
|
76
75
|
executables: []
|
77
76
|
extensions: []
|
78
77
|
extra_rdoc_files:
|
79
|
-
- README.md
|
80
78
|
- CHANGELOG.md
|
81
79
|
- CONTRIBUTING.md
|
80
|
+
- README.md
|
82
81
|
files:
|
83
82
|
- CHANGELOG.md
|
84
83
|
- CONTRIBUTING.md
|
@@ -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.7
|
169
166
|
specification_version: 4
|
170
167
|
summary: A modular Ruby webserver interface.
|
171
168
|
test_files: []
|