Skip to content

Instantly share code, notes, and snippets.

@lsiden
Created May 7, 2010 13:31
Show Gist options
  • Save lsiden/393420 to your computer and use it in GitHub Desktop.
Save lsiden/393420 to your computer and use it in GitHub Desktop.
diff --git a/lib/rack/chunked.rb b/lib/rack/chunked.rb
index dddf969..0ee8fb9 100644
--- a/lib/rack/chunked.rb
+++ b/lib/rack/chunked.rb
@@ -35,7 +35,7 @@ module Rack
def each
term = "\r\n"
@body.each do |chunk|
- size = bytesize(chunk)
+ size = chunk.nil? ? 0 : bytesize(chunk)
next if size == 0
yield [size.to_s(16), term, chunk, term].join
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment