rack 3.0.10 → 3.0.11

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
2
  SHA256:
3
- metadata.gz: '02708966a52d0c3f5837969a1be34245fe608b2b195e05a5f6d01a192c54a104'
4
- data.tar.gz: ce9f131cb863d4c4fd215cfc612cad5f90368187d20eaabd70db6f5cc8fd14ea
3
+ metadata.gz: 28b82d44ba189d0bbbc8bde52faa4aad3e333926291cdc20f62ede702b9cf02b
4
+ data.tar.gz: a40e034c12ec76cd6f9506dfac3ab12438e3c9ffb5c40a7417b0b463758dd40b
5
5
  SHA512:
6
- metadata.gz: 5d7a4f539b7abd7e28908da9c34d29ef6df3a1bb80e52ec656dc9324bdf5573b2213e82bb01175327f701c9275f404a790ddb3ee42ceeba7dac0d579f68f6cd6
7
- data.tar.gz: 125fb761b1d4e979936a4587146c41623d03c26561c8e36501efb25735cb8ff122bcf2fe77382850ea3c28559ef2aa3f5dba64dba86530c02359a6be6ac0a3bf
6
+ metadata.gz: 04b8e6d85dc1667f282320d629931407897342cfa2c04ec673ed7150dcb27592fd7c0624ee8d02d5f71dcd8370237b5bc425f43b5d92b6fd58aa311153b75e8f
7
+ data.tar.gz: b2720568c6fbc1b192e2b0dbbff7231ca4db86f56ff9c12e70385ba7d324c6f44938426071c022789a0f8d6d73a78e383b477332d39e873569860cc059ea1158
data/CHANGELOG.md CHANGED
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. For info on
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ - Backport #2062 to 3-0-stable: Do not allow `BodyProxy` to respond to `to_str`, make `to_ary` call close . ([#2062](https://github.com/rack/rack/pull/2062), [@jeremyevans](https://github.com/jeremyevans))
8
+
7
9
  ## [3.0.10] - 2024-03-21
8
10
 
9
11
  - Backport #2104 to 3-0-stable: Return empty when parsing a multi-part POST with only one end delimiter. ([#2164](https://github.com/rack/rack/pull/2164), [@JoeDupuis](https://github.com/JoeDupuis))
@@ -15,7 +15,12 @@ module Rack
15
15
 
16
16
  # Return whether the wrapped body responds to the method.
17
17
  def respond_to_missing?(method_name, include_all = false)
18
- super or @body.respond_to?(method_name, include_all)
18
+ case method_name
19
+ when :to_str
20
+ false
21
+ else
22
+ super or @body.respond_to?(method_name, include_all)
23
+ end
19
24
  end
20
25
 
21
26
  # If not already closed, close the wrapped body and
@@ -38,7 +43,18 @@ module Rack
38
43
 
39
44
  # Delegate missing methods to the wrapped body.
40
45
  def method_missing(method_name, *args, &block)
41
- @body.__send__(method_name, *args, &block)
46
+ case method_name
47
+ when :to_str
48
+ super
49
+ when :to_ary
50
+ begin
51
+ @body.__send__(method_name, *args, &block)
52
+ ensure
53
+ close
54
+ end
55
+ else
56
+ @body.__send__(method_name, *args, &block)
57
+ end
42
58
  end
43
59
  # :nocov:
44
60
  ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
data/lib/rack/response.rb CHANGED
@@ -33,7 +33,7 @@ module Rack
33
33
 
34
34
  # Deprecated, use headers instead.
35
35
  def header
36
- warn 'Rack::Response#header is deprecated and will be removed in Rack 3.1', uplevel: 1
36
+ warn 'Rack::Response#header is deprecated and will be removed in Rack 3.1, use #headers instead', uplevel: 1
37
37
 
38
38
  headers
39
39
  end
data/lib/rack/version.rb CHANGED
@@ -25,7 +25,7 @@ module Rack
25
25
  VERSION
26
26
  end
27
27
 
28
- RELEASE = "3.0.10"
28
+ RELEASE = "3.0.11"
29
29
 
30
30
  # Return the Rack release as a dotted string.
31
31
  def self.release
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.10
4
+ version: 3.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leah Neukirchen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-20 00:00:00.000000000 Z
11
+ date: 2024-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest