rack 3.1.14 → 3.1.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 558fa2ba3e85c5e5c3775d72153132d6f667aa7390421fb6769b6cc26dd3bd72
4
- data.tar.gz: 135df43165c5e6fa3a69cd4857ee2e514cfe7841ed3728889e61185268e86531
3
+ metadata.gz: 896b72d03d6dc508b253d4c42cef77142a3e8c762ed714db76716aaab4559c85
4
+ data.tar.gz: 2f4389afc58270dc839771c211af18f17855239f4d915b99a869006053e70bbe
5
5
  SHA512:
6
- metadata.gz: 3543b51083a592a6609ac760ee6b4a692b442496258470c3d70cd94ada81c22439c21e5637599e6d85fd0c25983fc0819883f2449466cfb3c41ed8154287b221
7
- data.tar.gz: a1da3c54d64e956c1b4b02065da3deaff9ef9e212e2c5366260691caef698bea993ceb9b26e0a26d72f37481fb0f0a91803fe99e864baffbbfa10e31ca4e79cc
6
+ metadata.gz: 2e71e0d00426e7d32763fd1ba73e61a755983a318e3ea87e2afcde76c420d6d17303fc56ad3dd021213b3069caad0b407246814e74333d698fc107a90f2acf95
7
+ data.tar.gz: 305486495349ad80067568bea8564095699e9730d8f60f0a12186eb3723f0032bba166e9748ab57d8f2f6bcd452158c5ba99070c3ca7a346c32f50f495687440
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.1.15] - 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.1.14] - 2025-05-06
6
10
 
7
11
  ### Security
@@ -139,6 +143,11 @@ Rack v3.1 is primarily a maintenance release that removes features deprecated in
139
143
 
140
144
  - In `Rack::Files`, ignore the `Range` header if served file is 0 bytes. ([#2159](https://github.com/rack/rack/pull/2159), [@zarqman])
141
145
 
146
+ ## [3.0.17] - 2025-05-18
147
+
148
+ - 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])
149
+
150
+
142
151
  ## [3.0.16] - 2025-05-06
143
152
 
144
153
  ### Security
@@ -343,6 +352,10 @@ Rack v3.1 is primarily a maintenance release that removes features deprecated in
343
352
  - 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))
344
353
  - `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))
345
354
 
355
+ ## [2.2.15] - 2025-05-18
356
+
357
+ - 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])
358
+
346
359
  ## [2.2.14] - 2025-05-06
347
360
 
348
361
  ### Security
@@ -1130,3 +1143,4 @@ Items below this line are from the previously maintained HISTORY.md and NEWS.md
1130
1143
  [@wjordan]: https://github.com/wjordan "Will Jordan"
1131
1144
  [@BlakeWilliams]: https://github.com/BlakeWilliams "Blake Williams"
1132
1145
  [@davidstosik]: https://github.com/davidstosik "David Stosik"
1146
+ [@earlopain]: https://github.com/earlopain "Earlopain"
@@ -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
@@ -83,7 +112,7 @@ module Rack
83
112
  Array(set_cookie_header).each do |cookie|
84
113
  cookie_name, cookie_filling = cookie.split('=', 2)
85
114
  cookie_attributes = identify_cookie_attributes cookie_filling
86
- parsed_cookie = CGI::Cookie.new(
115
+ parsed_cookie = Cookie.new(
87
116
  'name' => cookie_name.strip,
88
117
  'value' => cookie_attributes.fetch('value'),
89
118
  'path' => cookie_attributes.fetch('path', nil),
@@ -100,7 +129,7 @@ module Rack
100
129
  def identify_cookie_attributes(cookie_filling)
101
130
  cookie_bits = cookie_filling.split(';')
102
131
  cookie_attributes = Hash.new
103
- cookie_attributes.store('value', cookie_bits[0].strip)
132
+ cookie_attributes.store('value', Array(cookie_bits[0].strip))
104
133
  cookie_bits.drop(1).each do |bit|
105
134
  if bit.include? '='
106
135
  cookie_attribute, attribute_value = bit.split('=', 2)
data/lib/rack/version.rb CHANGED
@@ -12,7 +12,7 @@
12
12
  # so it should be enough just to <tt>require 'rack'</tt> in your code.
13
13
 
14
14
  module Rack
15
- RELEASE = "3.1.14"
15
+ RELEASE = "3.1.15"
16
16
 
17
17
  # Return the Rack release as a dotted string.
18
18
  def self.release
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.1.14
4
+ version: 3.1.15
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-06 00:00:00.000000000 Z
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
@@ -143,7 +142,6 @@ metadata:
143
142
  changelog_uri: https://github.com/rack/rack/blob/main/CHANGELOG.md
144
143
  documentation_uri: https://rubydoc.info/github/rack/rack
145
144
  source_code_uri: https://github.com/rack/rack
146
- post_install_message:
147
145
  rdoc_options: []
148
146
  require_paths:
149
147
  - lib
@@ -158,8 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
156
  - !ruby/object:Gem::Version
159
157
  version: '0'
160
158
  requirements: []
161
- rubygems_version: 3.5.22
162
- signing_key:
159
+ rubygems_version: 3.6.7
163
160
  specification_version: 4
164
161
  summary: A modular Ruby webserver interface.
165
162
  test_files: []