From 1691b589e05023eef2cd9c813a5f327f2d4f81b1 Mon Sep 17 00:00:00 2001 From: Carl Chenet Date: Sat, 20 May 2017 15:21:07 +0200 Subject: [PATCH] add a workaround to stop getting exception emails about IpSpoofAttackErrors --- app/controllers/application_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 77ee039..f62d64a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -8,6 +8,9 @@ class ApplicationController < ActionController::Base TAG_FILTER_COOKIE = :tag_filters def authenticate_user + # eagerly evaluate, in case this triggers an IpSpoofAttackError + request.remote_ip + if session[:u] && (user = User.where(:session_token => session[:u].to_s).first) && user.is_active?