rack 3.1.16 → 3.2.1
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 +80 -1
- data/README.md +41 -20
- data/SPEC.rdoc +199 -306
- data/lib/rack/auth/abstract/request.rb +2 -0
- data/lib/rack/builder.rb +6 -0
- data/lib/rack/conditional_get.rb +4 -3
- data/lib/rack/constants.rb +1 -0
- data/lib/rack/events.rb +21 -6
- data/lib/rack/head.rb +2 -3
- data/lib/rack/lint.rb +430 -457
- data/lib/rack/media_type.rb +6 -7
- data/lib/rack/mock_response.rb +19 -25
- data/lib/rack/multipart/parser.rb +33 -7
- data/lib/rack/multipart/uploaded_file.rb +42 -5
- data/lib/rack/query_parser.rb +41 -24
- data/lib/rack/request.rb +45 -54
- data/lib/rack/rewindable_input.rb +4 -1
- data/lib/rack/show_exceptions.rb +4 -2
- data/lib/rack/show_status.rb +0 -2
- data/lib/rack/utils.rb +14 -23
- data/lib/rack/version.rb +4 -8
- data/lib/rack.rb +0 -1
- metadata +5 -5
- data/lib/rack/logger.rb +0 -23
data/lib/rack/events.rb
CHANGED
@@ -29,12 +29,13 @@ module Rack
|
|
29
29
|
#
|
30
30
|
# * on_send(request, response)
|
31
31
|
#
|
32
|
-
# The webserver has started iterating over the response body
|
33
|
-
# has started sending data over the
|
34
|
-
# a request object and the response
|
35
|
-
# constructed from the rack triple that the
|
36
|
-
# SHOULD NOT be made to the response object
|
37
|
-
# started sending data. Any mutations will
|
32
|
+
# The webserver has started iterating over the response body, or has called
|
33
|
+
# the streaming body, and presumably has started sending data over the
|
34
|
+
# wire. This method is always called with a request object and the response
|
35
|
+
# object. The response object is constructed from the rack triple that the
|
36
|
+
# application returned. Changes SHOULD NOT be made to the response object
|
37
|
+
# as the webserver has already started sending data. Any mutations will
|
38
|
+
# likely result in an exception.
|
38
39
|
#
|
39
40
|
# * on_finish(request, response)
|
40
41
|
#
|
@@ -90,6 +91,20 @@ module Rack
|
|
90
91
|
@handlers.reverse_each { |handler| handler.on_send request, response }
|
91
92
|
super
|
92
93
|
end
|
94
|
+
|
95
|
+
def call(stream)
|
96
|
+
@handlers.reverse_each { |handler| handler.on_send request, response }
|
97
|
+
super
|
98
|
+
end
|
99
|
+
|
100
|
+
def respond_to?(method_name, include_all = false)
|
101
|
+
case method_name
|
102
|
+
when :each, :call
|
103
|
+
@body.respond_to?(method_name, include_all)
|
104
|
+
else
|
105
|
+
super
|
106
|
+
end
|
107
|
+
end
|
93
108
|
end
|
94
109
|
|
95
110
|
class BufferedResponse < Rack::Response::Raw # :nodoc:
|
data/lib/rack/head.rb
CHANGED
@@ -15,9 +15,8 @@ module Rack
|
|
15
15
|
_, _, body = response = @app.call(env)
|
16
16
|
|
17
17
|
if env[REQUEST_METHOD] == HEAD
|
18
|
-
|
19
|
-
|
20
|
-
end
|
18
|
+
body.close if body.respond_to?(:close)
|
19
|
+
response[2] = []
|
21
20
|
end
|
22
21
|
|
23
22
|
response
|