From e9c52a131dd6d01c710e5baccf6a9d974da1e01f Mon Sep 17 00:00:00 2001 From: Marko Juraga Date: Tue, 26 Mar 2024 13:27:23 +0100 Subject: [PATCH] BUG/MINOR: tcp_request_rule: fix unssuported action message --- configuration/tcp_request_rule.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/configuration/tcp_request_rule.go b/configuration/tcp_request_rule.go index 71e21b94..e32d146e 100644 --- a/configuration/tcp_request_rule.go +++ b/configuration/tcp_request_rule.go @@ -347,7 +347,7 @@ func ParseTCPRequestRule(f types.TCPType) (rule *models.TCPRequestRule, err erro rule.Cond = a.Cond rule.CondTest = a.CondTest default: - return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", a)) + return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", a)) } return rule, nil @@ -522,7 +522,7 @@ func ParseTCPRequestRule(f types.TCPType) (rule *models.TCPRequestRule, err erro rule.Cond = a.Cond rule.CondTest = a.CondTest default: - return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", a)) + return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", a)) } case *tcp_types.Session: rule = &models.TCPRequestRule{ @@ -594,10 +594,10 @@ func ParseTCPRequestRule(f types.TCPType) (rule *models.TCPRequestRule, err erro rule.Cond = a.Cond rule.CondTest = a.CondTest default: - return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", a)) + return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", a)) } default: - return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", v)) + return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", v)) } return rule, nil } @@ -802,7 +802,7 @@ func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err e }, }, nil } - return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", f.Action)) + return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", f.Action)) case models.TCPRequestRuleTypeContent: switch f.Action { case models.TCPRequestRuleActionAccept: @@ -1084,7 +1084,7 @@ func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err e }, }, nil } - return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", f.Action)) + return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", f.Action)) case models.TCPRequestRuleTypeSession: switch f.Action { case models.TCPRequestRuleActionAccept: @@ -1229,14 +1229,14 @@ func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err e }, }, nil } - return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", f.Action)) + return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", f.Action)) case models.TCPRequestRuleTypeInspectDashDelay: if f.Timeout == nil { - return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", f.Type)) + return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", f.Type)) } return &tcp_types.InspectDelay{ Timeout: strconv.FormatInt(*f.Timeout, 10), }, nil } - return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", f.Type)) + return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", f.Type)) }