Prefer remote_ip in GaEventsController (#19074)
This commit is contained in:
parent
cb3b12feaa
commit
cb2477a991
3 changed files with 3 additions and 2 deletions
|
|
@ -238,7 +238,7 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def anonymous_user
|
||||
User.new(ip_address: request.env["HTTP_FASTLY_CLIENT_IP"] || request.env["HTTP_X_FORWARDED_FOR"])
|
||||
User.new(ip_address: request.env["HTTP_FASTLY_CLIENT_IP"] || request.remote_ip)
|
||||
end
|
||||
|
||||
def initialize_stripe
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class GaEventsController < ApplicationController
|
|||
|
||||
def scrambled_ip
|
||||
crypt = ActiveSupport::MessageEncryptor.new(todays_key)
|
||||
crypt.encrypt_and_sign(request.env["HTTP_X_FORWARDED_FOR"] || request.remote_ip)
|
||||
crypt.encrypt_and_sign(request.env["HTTP_FASTLY_CLIENT_IP"] || request.remote_ip)
|
||||
end
|
||||
|
||||
def todays_key
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ describe('play or pause animated images', () => {
|
|||
|
||||
describe('no reduced motion preference', () => {
|
||||
beforeEach(() => {
|
||||
cy.testSetup();
|
||||
Cypress.on('window:before:load', (window) => {
|
||||
window.document.body = generateFakePageBody();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue