api: always encode timestamps wth RFC3339 (#1093)

this fixes "lastRequest" in /v1/hlsmuxers/list that was encoded in a
wrong format
This commit is contained in:
aler9
2022-08-23 13:22:07 +02:00
parent 02d3dd92e6
commit 960cfb9f99
3 changed files with 9 additions and 6 deletions

View File

@@ -469,6 +469,7 @@ func TestAPIProtocolSpecificList(t *testing.T) {
case "hls":
var out struct {
Items map[string]struct {
Created string `json:"created"`
LastRequest string `json:"lastRequest"`
} `json:"items"`
}
@@ -480,7 +481,9 @@ func TestAPIProtocolSpecificList(t *testing.T) {
firstID = k
}
require.NotEqual(t, "", out.Items[firstID].LastRequest)
s := fmt.Sprintf("^%d-", time.Now().Year())
require.Regexp(t, s, out.Items[firstID].Created)
require.Regexp(t, s, out.Items[firstID].LastRequest)
}
})
}