From 082c6317f0b680f4bcd3b1643e6481bed4606139 Mon Sep 17 00:00:00 2001
From: David Heinemeier Hansson <david@loudthinking.com>
Date: Sat, 20 Jun 2015 17:03:43 +0200
Subject: Update request to do the env_config merge and add cookies helper

---
 lib/action_cable/connection/base.rb | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

(limited to 'lib/action_cable')

diff --git a/lib/action_cable/connection/base.rb b/lib/action_cable/connection/base.rb
index 52f94a7ab0..295b71ecb3 100644
--- a/lib/action_cable/connection/base.rb
+++ b/lib/action_cable/connection/base.rb
@@ -109,6 +109,14 @@ module ActionCable
       end
 
       protected
+        def request
+          @request ||= ActionDispatch::Request.new(Rails.application.env_config.merge(env))
+        end
+
+        def cookies
+          request.cookie_jar
+        end
+
         def initialize_connection
           server.add_connection(self)
 
@@ -173,10 +181,6 @@ module ActionCable
           @websocket && @websocket.ready_state == Faye::WebSocket::API::OPEN
         end
 
-        def request
-          @request ||= ActionDispatch::Request.new(env)
-        end
-
         def websocket?
           @is_websocket ||= Faye::WebSocket.websocket?(@env)
         end
-- 
cgit v1.2.3