Rainbows! 3.1.0 - minor updates
[rainbows.git] / lib / rainbows / http_response.rb
blob564d2d0ff894382b60eac5fee6bcfc418cf89abf
1 # -*- encoding: binary -*-
2 # :enddoc:
3 # deprecated, use Rainbows::Response instead
4 # Cramp 0.11 relies on this, and is only activated by Cramp
5 if defined?(Cramp) && defined?(Rainbows::EventMachine::Client)
6   class Rainbows::HttpResponse
7     # dummy method for Cramp to alias_method_chain
8     def self.write(client, response, out)
9     end
10   end
12   module Rainbows::EventMachine::CrampSocket
13     def em_write_response(response, alive = false)
14       if websocket?
15         write web_socket_upgrade_data
16         web_socket_handshake!
17         response[1] = nil # disable response headers
18       end
19       super
20     end
21   end
23   class Rainbows::EventMachine::Client
24     include Rainbows::EventMachine::CrampSocket
25   end
26 end