about summary refs log tree commit diff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorJustin Tracey <j2tracey@gmail.com>2021-02-19 08:56:14 +0000
committerGitHub <noreply@github.com>2021-02-19 09:56:14 +0100
commitc9e8e1739c698291e1b034d19a1b01d75c9e039b (patch)
tree4d1aa255c0d76e2f518f611582dae2d09f84af02 /app/controllers/application_controller.rb
parentfc145de23865ebc957cde50f66844bcfad475e47 (diff)
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.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index c9311c1b6..5b7eec94f 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -43,7 +43,7 @@ class ApplicationController < ActionController::Base
   private
 
   def https_enabled?
-    Rails.env.production? && !request.path.start_with?('/health') && !request.headers["Host"].ends_with?(".onion")
+    Rails.env.production? && !request.path.start_with?('/health') && !request.headers["Host"].end_with?(".onion")
   end
 
   def authorized_fetch_mode?