# File lib/puppet/network/http/mongrel/rest.rb, line 52
52:   def set_response(response, result, status = 200)
53:     # Set the 'reason' (or 'message', as it's called in Webrick), when
54:     # we have a failure, unless we're on a version of mongrel that doesn't
55:     # support this.
56:     if status < 300
57:       unless result.is_a?(File)
58:         response.start(status) { |head, body| body.write(result) }
59:       else
60:         response.start(status) { |head, body| }
61:         response.send_status(result.stat.size)
62:         response.send_header
63:         response.send_file(result.path)
64:       end
65:     else
66:       begin
67:         response.start(status,false,result) { |head, body| body.write(result) }
68:       rescue ArgumentError
69:         response.start(status)              { |head, body| body.write(result) }
70:       end
71:     end
72:   end