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:
@@ -1369,9 +1369,7 @@ func CreateCookiePattern(c *testutil.Client, categoryID string, attrs ...Attrs)
|
|||||||
"description": a.getString("description", "Test cookie pattern"),
|
"description": a.getString("description", "Test cookie pattern"),
|
||||||
}
|
}
|
||||||
if _, ok := a["maxAgeSeconds"]; ok {
|
if _, ok := a["maxAgeSeconds"]; ok {
|
||||||
if v, ok := a["maxAgeSeconds"].(int); ok {
|
input["maxAgeSeconds"] = a.getInt("maxAgeSeconds", 0)
|
||||||
input["maxAgeSeconds"] = v
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var result struct {
|
var result struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user