Skip to content

Commit

Permalink
Echo body as well
Browse files Browse the repository at this point in the history
  • Loading branch information
boazsegev committed Dec 8, 2019
1 parent 7618897 commit d29da53
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/shootout.ru
Expand Up @@ -23,7 +23,11 @@ module ShootoutApp
request.params.each { |k,v| out << "#{k}: #{v}\n" ; len += out[-1].length }
end
if(env['rack.input'])
env['rack.input'].rewind
out << "Body\n\n"
out << env['rack.input'].read
len += out[-1].length + 6
out << "\n\nBody Length: #{out[-1].length}\n\n"
len += out[-1].length
end
[200, { 'Content-Length' => len.to_s, 'Content-Type' => 'text/plain; charset=UTF-8;' }, out]
Expand Down

0 comments on commit d29da53

Please sign in to comment.