lib/em-http-server/response.rb in em-http-server-0.1.4 vs lib/em-http-server/response.rb in em-http-server-0.1.5
- old
+ new
@@ -140,10 +140,10 @@
# In the case of multiparts, we ASSUME we will get called before any content
# gets sent out, because the multipart boundary is created here.
#
def fixup_headers
if @content
- @headers["Content-length"] = @content.to_s.length
+ @headers["Content-length"] = content.to_s.bytesize
elsif @chunks
@headers["Transfer-encoding"] = "chunked"
# Might be nice to ENSURE there is no content-length header,
# but how to detect all the possible permutations of upper/lower case?
elsif @multiparts