mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-11-02 20:04:01 +08:00
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:
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user