File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ def self.wrap(original_body, appsignal_transaction)
25
25
elsif original_body . respond_to? ( :to_ary )
26
26
ArrayableBodyWrapper . new ( original_body , appsignal_transaction )
27
27
elsif !original_body . respond_to? ( :each ) && original_body . respond_to? ( :call )
28
- CallableBodyWrapper . new ( original_body , appsignal_transaction )
28
+ # This body only supports #call, so we must be running a Rack 3 application
29
+ # It is possible that a body exposes both `each` and `call` in the hopes of
30
+ # being backwards-compatible with both Rack 3.x and Rack 2.x, however
31
+ # this is not going to work since the SPEC says that if both are available,
32
+ # `each` should be used and `call` should be ignored.
33
+ # So for that case we can drop by to our default EnumerableBodyWrapper
34
+ CallableBodyWrapper . new ( original_body , appsignal_transaction_or_nil )
29
35
else
30
36
EnumerableBodyWrapper . new ( original_body , appsignal_transaction )
31
37
end
You can’t perform that action at this time.
0 commit comments