From 6edfcdd4aa896dbbf431fcf3992e0d1cd2dac3b2 Mon Sep 17 00:00:00 2001 From: Jon Moss Date: Thu, 11 Feb 2016 19:41:27 -0500 Subject: Fix `request.ssl?` bug with Action Cable This bug affects `wss://` requests when running Action Cable in-app. Fixes #23620. --- actionpack/lib/action_dispatch/http/request.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 5427425ef7..316a9f08b7 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -403,6 +403,10 @@ module ActionDispatch def commit_flash end + def ssl? + super || scheme == 'wss'.freeze + end + private def check_method(name) HTTP_METHOD_LOOKUP[name] || raise(ActionController::UnknownHttpMethod, "#{name}, accepted HTTP methods are #{HTTP_METHODS[0...-1].join(', ')}, and #{HTTP_METHODS[-1]}") -- cgit v1.2.3