From b9fcb25f1a15a166878748d8b926f58690aff243 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 19 Mar 2024 21:41:45 +0100 Subject: [PATCH] set Current.application_name --- app/controllers/application_controller.rb | 6 ++++++ app/models/current.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 469c6e060..e131110f5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -31,6 +31,12 @@ class ApplicationController < ActionController::Base # TODO: remove this block when migration to new domain is done # headers['Host'] instead of request.host to keep the port (ex: localhost:3000) Current.host = request.headers['Host'] + + if Current.host.include?("gouv.fr") + Current.application_name = "demarches.gouv.fr" + else + Current.application_name = APPLICATION_NAME + end end def staging_authenticate diff --git a/app/models/current.rb b/app/models/current.rb index e7d4f2a6a..1c27c1973 100644 --- a/app/models/current.rb +++ b/app/models/current.rb @@ -1,3 +1,3 @@ class Current < ActiveSupport::CurrentAttributes - attribute :user, :request_id, :browser, :host + attribute :user, :request_id, :browser, :host, :application_name end