Fix maxAgeSeconds type handling in cookie pattern factory

The inline int type assertion silently dropped int64 and float64
values already supported by Attrs.getInt.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-01 15:59:56 +04:00
parent d133d5ba1d
commit 6d22d68acf

View File

@@ -1369,9 +1369,7 @@ func CreateCookiePattern(c *testutil.Client, categoryID string, attrs ...Attrs)
"description": a.getString("description", "Test cookie pattern"),
}
if _, ok := a["maxAgeSeconds"]; ok {
if v, ok := a["maxAgeSeconds"].(int); ok {
input["maxAgeSeconds"] = v
}
input["maxAgeSeconds"] = a.getInt("maxAgeSeconds", 0)
}
var result struct {