lib/faye/websocket/adapter.rb in faye-websocket-0.7.1 vs lib/faye/websocket/adapter.rb in faye-websocket-0.7.2
- old
+ new
@@ -2,15 +2,15 @@
class WebSocket
module Adapter
def websocket?
e = defined?(@env) ? @env : env
- WebSocket.websocket?(e)
+ e && WebSocket.websocket?(e)
end
def eventsource?
e = defined?(@env) ? @env : env
- EventSource.eventsource?(e)
+ e && EventSource.eventsource?(e)
end
def socket_connection?
websocket? or eventsource?
end