aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/connection/client_socket.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 19:13:46 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 19:13:46 +0200
commitb678eb57e93423ac8e2a0cc0b083ce556c6fb130 (patch)
tree7cba336a3a15179b3b549c34a4b0d0e2474f62cd /actioncable/lib/action_cable/connection/client_socket.rb
parentb91ff557ef6f621d1b921f358fd5b8a5d9e9090e (diff)
downloadrails-b678eb57e93423ac8e2a0cc0b083ce556c6fb130.tar.gz
rails-b678eb57e93423ac8e2a0cc0b083ce556c6fb130.tar.bz2
rails-b678eb57e93423ac8e2a0cc0b083ce556c6fb130.zip
applies new string literal convention in actioncable/lib
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'actioncable/lib/action_cable/connection/client_socket.rb')
-rw-r--r--actioncable/lib/action_cable/connection/client_socket.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/actioncable/lib/action_cable/connection/client_socket.rb b/actioncable/lib/action_cable/connection/client_socket.rb
index 6f29f32ea9..d573a68f70 100644
--- a/actioncable/lib/action_cable/connection/client_socket.rb
+++ b/actioncable/lib/action_cable/connection/client_socket.rb
@@ -1,4 +1,4 @@
-require 'websocket/driver'
+require "websocket/driver"
module ActionCable
module Connection
@@ -8,16 +8,16 @@ module ActionCable
# Copyright (c) 2010-2015 James Coglan
class ClientSocket # :nodoc:
def self.determine_url(env)
- scheme = secure_request?(env) ? 'wss:' : 'ws:'
+ scheme = secure_request?(env) ? "wss:" : "ws:"
"#{ scheme }//#{ env['HTTP_HOST'] }#{ env['REQUEST_URI'] }"
end
def self.secure_request?(env)
- return true if env['HTTPS'] == 'on'
- return true if env['HTTP_X_FORWARDED_SSL'] == 'on'
- return true if env['HTTP_X_FORWARDED_SCHEME'] == 'https'
- return true if env['HTTP_X_FORWARDED_PROTO'] == 'https'
- return true if env['rack.url_scheme'] == 'https'
+ return true if env["HTTPS"] == "on"
+ return true if env["HTTP_X_FORWARDED_SSL"] == "on"
+ return true if env["HTTP_X_FORWARDED_SCHEME"] == "https"
+ return true if env["HTTP_X_FORWARDED_PROTO"] == "https"
+ return true if env["rack.url_scheme"] == "https"
return false
end
@@ -37,7 +37,7 @@ module ActionCable
@url = ClientSocket.determine_url(@env)
@driver = @driver_started = nil
- @close_params = ['', 1006]
+ @close_params = ["", 1006]
@ready_state = CONNECTING
@@ -56,7 +56,7 @@ module ActionCable
return if @driver.nil? || @driver_started
@stream.hijack_rack_socket
- if callback = @env['async.callback']
+ if callback = @env["async.callback"]
callback.call([101, {}, @stream])
end
@@ -87,7 +87,7 @@ module ActionCable
def close(code = nil, reason = nil)
code ||= 1000
- reason ||= ''
+ reason ||= ""
unless code == 1000 or (code >= 3000 and code <= 4999)
raise ArgumentError, "Failed to execute 'close' on WebSocket: " +