From c9e8e1739c698291e1b034d19a1b01d75c9e039b Mon Sep 17 00:00:00 2001 From: Justin Tracey Date: Fri, 19 Feb 2021 08:56:14 +0000 Subject: replace all instances of "ends_with?" with "end_with?" (#15745) The "ends_with?" method is just a Rails alias of Ruby's "end_with?" method. Using the latter makes the code less brittle. --- lib/action_dispatch/cookie_jar_extensions.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/action_dispatch/cookie_jar_extensions.rb') diff --git a/lib/action_dispatch/cookie_jar_extensions.rb b/lib/action_dispatch/cookie_jar_extensions.rb index 492c04065..1be9053ba 100644 --- a/lib/action_dispatch/cookie_jar_extensions.rb +++ b/lib/action_dispatch/cookie_jar_extensions.rb @@ -7,7 +7,7 @@ module ActionDispatch # Monkey-patch ActionDispatch to serve secure cookies to Tor Hidden Service # users. Otherwise, ActionDispatch would drop the cookie over HTTP. def write_cookie?(*) - request.host.ends_with?('.onion') || super + request.host.end_with?('.onion') || super end end end @@ -17,7 +17,7 @@ ActionDispatch::Cookies::CookieJar.prepend(ActionDispatch::CookieJarExtensions) module Rack module SessionPersistedExtensions def security_matches?(request, options) - request.host.ends_with?('.onion') || super + request.host.end_with?('.onion') || super end end end -- cgit