From 6edcfa69464bc36fb6c1f952b3bc04b189d40db2 Mon Sep 17 00:00:00 2001 From: Yuli Date: Mon, 17 Feb 2020 20:24:24 +0200 Subject: [PATCH] add new tests and fix small bugs --- src/consent_api.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/consent_api.go b/src/consent_api.go index 8af4f38..2a4add8 100644 --- a/src/consent_api.go +++ b/src/consent_api.go @@ -113,24 +113,16 @@ func (e mainEnv) consentAccept(w http.ResponseWriter, r *http.Request, ps httpro switch records["expiration"].(type) { case string: expiration, _ = parseExpiration(value.(string)) - case int: - expiration = value.(int32) - case int32: - expiration = value.(int32) - case int64: - expiration = value.(int32) + case float64: + expiration = int32(value.(float64)) } } if value, ok := records["starttime"]; ok { switch records["starttime"].(type) { case string: starttime, _ = parseExpiration(value.(string)) - case int: - starttime = value.(int32) - case int32: - starttime = value.(int32) - case int64: - starttime = value.(int32) + case float64: + starttime = int32(value.(float64)) } } switch mode {