From 617007a56d42677a956545300f6b04575284c7c9 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Wed, 18 May 2022 13:02:55 +0530 Subject: [PATCH] MM-42379: Do not set TrustedProxyIPHeader for new instances (#20217) We move away with the update logic and just set an empty slice always. ```release-note The value of ServiceSettings.TrustedProxyIPHeader will default to empty from now on. A previous bug prevented this from happening in certain conditions. Customers are requested to check for these values in their config and set them to nil if necessary. ``` --- model/config.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/model/config.go b/model/config.go index f4abddd1a6..fd89cde57d 100644 --- a/model/config.go +++ b/model/config.go @@ -545,13 +545,7 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) { s.Forward80To443 = NewBool(false) } - if isUpdate { - // When updating an existing configuration, ensure that defaults are set. - if s.TrustedProxyIPHeader == nil { - s.TrustedProxyIPHeader = []string{HeaderForwarded, HeaderRealIP} - } - } else { - // When generating a blank configuration, leave the list empty. + if s.TrustedProxyIPHeader == nil { s.TrustedProxyIPHeader = []string{} }