Skip to content

Commit

Permalink
invalid Content-Length when body contained UTF characters
Browse files Browse the repository at this point in the history
  • Loading branch information
kfigiela committed Jun 4, 2011
1 parent c8622d5 commit 208c920
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/toto.rb
Expand Up @@ -338,7 +338,7 @@ def call env
response = @site.go(route, env, *(mime ? mime : []))

@response.body = [response[:body]]
@response['Content-Length'] = response[:body].length.to_s unless response[:body].empty?
@response['Content-Length'] = response[:body].bytesize.to_s unless response[:body].empty?
@response['Content-Type'] = Rack::Mime.mime_type(".#{response[:type]}")

# Set http cache headers
Expand Down

0 comments on commit 208c920

Please sign in to comment.