rack 3.1.0 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rack might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7f3809c29e2dad213f5abbdace8e3b7633072c2d3741ef484346ca07b8a9e0d
4
- data.tar.gz: a05cea9deeb8173edc7a5e5a0647abbf0f8ff1906f74543ad6970311ab4d3a52
3
+ metadata.gz: c5d6ff669a9e2d87cf8c2fb3fe727be68d2ac5df2a80a802163ed2cff8905627
4
+ data.tar.gz: 9e9917744a2d792217fb2f94c3d784fe6fcb0b4c44f7f34b864eafc50f329eb6
5
5
  SHA512:
6
- metadata.gz: 357615f5163669e77b81660145353bf29d926ab5d92e36e958ae65063c993d9c9411b868090bc99fa6e72a8bd7e82ba5cb430343556a399e2d75acdb45000b62
7
- data.tar.gz: 840039910ee854ec1bccff2d3078fb5b187f093480836d6023e290c49925e36e953a1a37372d619a5d3118f1d52fb7b904fed7623688c9b41ea7a7803960fcbb
6
+ metadata.gz: 293185b6af220249e49546d5a200e2cc2b55ff6e2424f472c5f01bdc37f3ed4e3aa4dc54df52108c3a42b7738c2e87dde74891f761f6120959b486f6e8b5eb29
7
+ data.tar.gz: d36b0721982e00065ee52a54719e86cb1914ec3086629c3958b6d510c9dd513ac75749be55008a5755e96ab918b302cb867719a256e50aced434361225c60da3
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
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.2] - 2024-06-11
6
+
7
+ ## Changed
8
+
9
+ - `Rack::Response` will take in to consideration chunked encoding responses ([#2204](https://github.com/rack/rack/pull/2204), [@tenderlove])
10
+
11
+ ## [3.1.1] - 2024-06-11
12
+
13
+ - Oops, I shouldn't have shipped this
14
+
5
15
  ## [3.1.0] - 2024-06-11
6
16
 
7
17
  ### SPEC Changes
@@ -22,6 +22,7 @@ module Rack
22
22
  ETAG = 'etag'
23
23
  EXPIRES = 'expires'
24
24
  SET_COOKIE = 'set-cookie'
25
+ TRANSFER_ENCODING = 'transfer-encoding'
25
26
 
26
27
  # HTTP method verbs
27
28
  GET = 'GET'
@@ -21,6 +21,7 @@ module Rack
21
21
 
22
22
  if !STATUS_WITH_NO_ENTITY_BODY.key?(status.to_i) &&
23
23
  !headers[CONTENT_LENGTH] &&
24
+ !headers[TRANSFER_ENCODING] &&
24
25
  body.respond_to?(:to_ary)
25
26
 
26
27
  response[2] = body = body.to_ary
data/lib/rack/response.rb CHANGED
@@ -25,6 +25,7 @@ module Rack
25
25
  self.new(body, status, headers)
26
26
  end
27
27
 
28
+ CHUNKED = 'chunked'
28
29
  STATUS_WITH_NO_ENTITY_BODY = Utils::STATUS_WITH_NO_ENTITY_BODY
29
30
 
30
31
  attr_accessor :length, :status, :body
@@ -89,7 +90,11 @@ module Rack
89
90
  self.status = status
90
91
  self.location = target
91
92
  end
92
-
93
+
94
+ def chunked?
95
+ CHUNKED == get_header(TRANSFER_ENCODING)
96
+ end
97
+
93
98
  def no_entity_body?
94
99
  # The response body is an enumerable body and it is not allowed to have an entity body.
95
100
  @body.respond_to?(:each) && STATUS_WITH_NO_ENTITY_BODY[@status]
@@ -105,7 +110,7 @@ module Rack
105
110
  close
106
111
  return [@status, @headers, []]
107
112
  else
108
- if @length && @length > 0
113
+ if @length && @length > 0 && !chunked?
109
114
  set_header CONTENT_LENGTH, @length.to_s
110
115
  end
111
116
 
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.0"
15
+ RELEASE = "3.1.2"
16
16
 
17
17
  # Return the Rack release as a dotted string.
18
18
  def self.release
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leah Neukirchen
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubygems_version: 3.5.9
161
+ rubygems_version: 3.5.3
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: A modular Ruby webserver interface.