Skip to content

Commit

Permalink
fixed codegram#11, content-length has to be set to body#bytesize inst…
Browse files Browse the repository at this point in the history
…ead of #length
  • Loading branch information
gucki committed Jul 27, 2011
1 parent 9a298f1 commit 0d67680
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rack/webconsole/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def call(env)
# Inject the html, css and js code to the view
response_body.gsub!('</body>', "#{code}</body>")

headers['Content-Length'] = response_body.length.to_s
headers['Content-Length'] = response_body.bytesize.to_s

[status, headers, [response_body]]
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/webconsole/repl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def call(env)
response_body = {:result => result}.to_json
headers = {}
headers['Content-Type'] = 'application/json'
headers['Content-Length'] = response_body.length.to_s
headers['Content-Length'] = response_body.bytesize.to_s
[200, headers, [response_body]]
end

Expand Down

0 comments on commit 0d67680

Please sign in to comment.