log forwarded host

This commit is contained in:
Donovan Daniels 2024-05-02 23:09:44 -05:00
parent e2b48e2f5c
commit 76dd6337a2
Signed by: Donovan_DMC
GPG Key ID: 907D29CBFD6157BA
4 changed files with 9 additions and 5 deletions

View File

@ -59,7 +59,7 @@ Rails.application.configure do
.then { |logger| ActiveSupport::TaggedLogging.new(logger) } .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
# Prepend all log lines with the following tags. # Prepend all log lines with the following tags.
config.log_tags = %i[request_id host] config.log_tags = %i[request_id forwarded_host]
# Info include generic and useful information about system operation, but avoids logging too much # Info include generic and useful information about system operation, but avoids logging too much
# information to avoid inadvertent exposure of personally identifiable information (PII). If you # information to avoid inadvertent exposure of personally identifiable information (PII). If you

View File

@ -0,0 +1,8 @@
# frozen_string_literal: true
module RequestExtension
def forwarded_host
headers["X-Forwarded-Host"] || host
end
end
ActiveSupport.on_load(:action_dispatch_request) { include RequestExtension }

View File

@ -1,5 +1,3 @@
version: "3"
x-environment: &common-env x-environment: &common-env
WEBSITES_READONLY: "${READONLY:-0}" WEBSITES_READONLY: "${READONLY:-0}"

View File

@ -1,5 +1,3 @@
version: "3"
x-environment: &common-env x-environment: &common-env
WEBSITES_READONLY: "${READONLY:-0}" WEBSITES_READONLY: "${READONLY:-0}"