aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable/connection/base.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2015-06-22 16:19:30 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2015-06-22 16:19:30 +0200
commit82f13443a508600a94319ce0e636d04f0ed4673e (patch)
tree8c6cc53602e43d526bc89d4d7a7c3192b59076db /lib/action_cable/connection/base.rb
parenta7607928e341eea7740b27f3ae507c26c7a68c56 (diff)
downloadrails-82f13443a508600a94319ce0e636d04f0ed4673e.tar.gz
rails-82f13443a508600a94319ce0e636d04f0ed4673e.tar.bz2
rails-82f13443a508600a94319ce0e636d04f0ed4673e.zip
Spacing
Diffstat (limited to 'lib/action_cable/connection/base.rb')
-rw-r--r--lib/action_cable/connection/base.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/action_cable/connection/base.rb b/lib/action_cable/connection/base.rb
index 7db554294a..5951198f36 100644
--- a/lib/action_cable/connection/base.rb
+++ b/lib/action_cable/connection/base.rb
@@ -120,16 +120,17 @@ module ActionCable
log_exception(e)
end
-
def decode_json(json)
ActiveSupport::JSON.decode json
end
+
def respond_to_invalid_request
logger.info finished_request_message
[ 404, { 'Content-Type' => 'text/plain' }, [ 'Page not found' ] ]
end
+
def websocket_alive?
websocket && websocket.ready_state == Faye::WebSocket::API::OPEN
end
@@ -138,6 +139,7 @@ module ActionCable
@is_websocket ||= Faye::WebSocket.websocket?(@env)
end
+
def started_request_message
'Started %s "%s"%s for %s at %s' % [
request.request_method,
@@ -155,6 +157,7 @@ module ActionCable
Time.now.to_default_s ]
end
+
def log_exception(e)
logger.error "There was an exception: #{e.class} - #{e.message}"
logger.error e.backtrace.join("\n")