Ignores invalid timestamps in requests (use current time)
Fix this issue: https://www.reddit.com/r/navidrome/comments/ql3imf/scrobbling_fails_when_using_substreamer/
This commit is contained in:
@@ -92,6 +92,13 @@ var _ = Describe("Request Helpers", func() {
|
||||
It("returns all param occurrences as []time.Time", func() {
|
||||
Expect(ParamTimes(r, "t")).To(Equal([]time.Time{d1, d2}))
|
||||
})
|
||||
It("returns current time as default if param is invalid", func() {
|
||||
now := time.Now()
|
||||
r = httptest.NewRequest("GET", "/ping?t=null", nil)
|
||||
times := ParamTimes(r, "t")
|
||||
Expect(times).To(HaveLen(1))
|
||||
Expect(times[0]).To(BeTemporally(">=", now))
|
||||
})
|
||||
})
|
||||
|
||||
Describe("ParamInt", func() {
|
||||
|
||||
Reference in New Issue
Block a user