summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-01-08 20:28:15 +1300
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-01-08 20:28:15 +1300
commit126a3800ec37f50ed017a56b6bdab4d15fc78a75 (patch)
tree82d6f043a8cb219f9d0ef9120302a4177d14c243
parentb93ae089ac201bd2397233e75687b1a7dec60fbf (diff)
downloadrack-126a3800ec37f50ed017a56b6bdab4d15fc78a75.tar.gz
Don't propagate nil values.response-body-compact
Some middleware is generating `[nil]` bodies. Previous implementation would filter these. So, we reproduce this behaviour when buffering the body.
-rw-r--r--lib/rack/response.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rack/response.rb b/lib/rack/response.rb
index ab94a4e3..5c8dbab9 100644
--- a/lib/rack/response.rb
+++ b/lib/rack/response.rb
@@ -227,7 +227,7 @@ module Rack
if @body.is_a?(Array)
# The user supplied body was an array:
- @body = @body.dup
+ @body = @body.compact
else
# Turn the user supplied body into a buffered array:
body = @body