aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/feature_policy.rb2
-rw-r--r--actionpack/lib/action_dispatch/middleware/cookies.rb8
-rw-r--r--actionpack/lib/action_dispatch/system_testing/browser.rb4
3 files changed, 9 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/http/feature_policy.rb b/actionpack/lib/action_dispatch/http/feature_policy.rb
index 78e982918d..c09690f9fc 100644
--- a/actionpack/lib/action_dispatch/http/feature_policy.rb
+++ b/actionpack/lib/action_dispatch/http/feature_policy.rb
@@ -42,7 +42,7 @@ module ActionDispatch #:nodoc:
end
def policy_empty?(policy)
- policy.try(:directives) && policy.directives.empty?
+ policy&.directives&.empty?
end
end
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb
index 96bdf570af..9d94d94ffb 100644
--- a/actionpack/lib/action_dispatch/middleware/cookies.rb
+++ b/actionpack/lib/action_dispatch/middleware/cookies.rb
@@ -532,9 +532,13 @@ module ActionDispatch
if value
case
when needs_migration?(value)
- self[name] = Marshal.load(value)
+ Marshal.load(value).tap do |v|
+ self[name] = { value: v }
+ end
when rotate
- self[name] = serializer.load(value)
+ serializer.load(value).tap do |v|
+ self[name] = { value: v }
+ end
else
serializer.load(value)
end
diff --git a/actionpack/lib/action_dispatch/system_testing/browser.rb b/actionpack/lib/action_dispatch/system_testing/browser.rb
index e861e52f09..91f332be13 100644
--- a/actionpack/lib/action_dispatch/system_testing/browser.rb
+++ b/actionpack/lib/action_dispatch/system_testing/browser.rb
@@ -47,14 +47,14 @@ module ActionDispatch
case type
when :chrome
if ::Selenium::WebDriver::Service.respond_to? :driver_path=
- ::Selenium::WebDriver::Chrome::Service.driver_path.try(:call)
+ ::Selenium::WebDriver::Chrome::Service.driver_path&.call
else
# Selenium <= v3.141.0
::Selenium::WebDriver::Chrome.driver_path
end
when :firefox
if ::Selenium::WebDriver::Service.respond_to? :driver_path=
- ::Selenium::WebDriver::Firefox::Service.driver_path.try(:call)
+ ::Selenium::WebDriver::Firefox::Service.driver_path&.call
else
# Selenium <= v3.141.0
::Selenium::WebDriver::Firefox.driver_path