mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
For now, each content-type gets special treatment in the Camping handler.
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@158 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
parent
c8e46fcb00
commit
001a467abd
1 changed files with 7 additions and 3 deletions
|
@ -46,12 +46,14 @@ module Mongrel
|
|||
end
|
||||
end
|
||||
end
|
||||
response.send_status((sendfile and File.size(sendfile) or clength))
|
||||
response.send_header
|
||||
|
||||
if sendfile
|
||||
response.send_status(File.size(sendfile))
|
||||
response.send_header
|
||||
response.send_file(sendfile)
|
||||
elsif controller.body.respond_to? :read
|
||||
response.send_status(clength)
|
||||
response.send_header
|
||||
while chunk = controller.body.read(16384)
|
||||
response.write(chunk)
|
||||
end
|
||||
|
@ -59,7 +61,9 @@ module Mongrel
|
|||
controller.body.close
|
||||
end
|
||||
else
|
||||
response.write(controller.body)
|
||||
response.send_status(controller.body.length)
|
||||
response.send_header
|
||||
response.write(controller.body.to_s)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue