diff options
-rw-r--r-- | lib/action_cable/connection/base.rb | 5 |
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") |