diff --git a/core/settings_model.go b/core/settings_model.go index 1fb6033f..5344fbd7 100644 --- a/core/settings_model.go +++ b/core/settings_model.go @@ -581,18 +581,6 @@ type TrustedProxyConfig struct { UseLeftmostIP bool `form:"useLeftmostIP" json:"useLeftmostIP"` } -// MarshalJSON implements the [json.Marshaler] interface. -func (c TrustedProxyConfig) MarshalJSON() ([]byte, error) { - type alias TrustedProxyConfig - - // serialize as empty array - if c.Headers == nil { - c.Headers = []string{} - } - - return json.Marshal(alias(c)) -} - // Validate makes RateLimitRule validatable by implementing [validation.Validatable] interface. func (c TrustedProxyConfig) Validate() error { return nil @@ -640,21 +628,6 @@ func (c *RateLimitsConfig) FindRateLimitRule(searchLabels []string, optOnlyAudie return RateLimitRule{}, false } -// MarshalJSON implements the [json.Marshaler] interface. -func (c RateLimitsConfig) MarshalJSON() ([]byte, error) { - type alias RateLimitsConfig - - // serialize as empty array - if c.Rules == nil { - c.Rules = []RateLimitRule{} - } - if c.ExcludedIPs == nil { - c.ExcludedIPs = []string{} - } - - return json.Marshal(alias(c)) -} - // Validate makes RateLimitsConfig validatable by implementing [validation.Validatable] interface. func (c RateLimitsConfig) Validate() error { return validation.ValidateStruct(&c,