Skip to content

Commit 773ebc7

Browse files
committed
BUG/MINOR: filter: don't validate timeouts and sizes as numbers
1 parent 200bafd commit 773ebc7

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

parsers/filters/filters-bwlim.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package filters
1818

1919
import (
2020
"fmt"
21-
"strconv"
2221
"strings"
2322

2423
"github.com/haproxytech/config-parser/v4/common"
@@ -77,36 +76,18 @@ func (b *BandwidthLimit) parsePart(parts []string, index int) error {
7776
part := parts[index]
7877
switch part {
7978
case "default-limit":
80-
if _, err := strconv.ParseInt(parts[index+1], 10, 64); err != nil {
81-
return fmt.Errorf("%s expects a value in milliseconds: %w", part, err)
82-
}
83-
8479
b.DefaultLimit = parts[index+1]
8580
case "limit":
86-
if _, err := strconv.ParseInt(parts[index+1], 10, 64); err != nil {
87-
return fmt.Errorf("%s expects a value in milliseconds: %w", part, err)
88-
}
89-
9081
b.Limit = parts[index+1]
9182
case "key":
9283
b.Key = parts[index+1]
9384
case "default-period":
94-
if _, err := strconv.ParseInt(parts[index+1], 10, 64); err != nil {
95-
return fmt.Errorf("%s expects a value in milliseconds: %w", part, err)
96-
}
97-
9885
b.DefaultPeriod = parts[index+1]
9986
case "min-size":
100-
if _, err := strconv.ParseInt(parts[index+1], 10, 64); err != nil {
101-
return fmt.Errorf("min-size expects a value in milliseconds: %w", err)
102-
}
103-
10487
v := parts[index+1]
105-
10688
b.MinSize = &v
10789
case "table":
10890
v := parts[index+1]
109-
11091
b.Table = &v
11192
default:
11293
return fmt.Errorf("unsupported option: %s", part)

0 commit comments

Comments
 (0)