mirror of
https://git.sr.ht/~joren/streamrip-go
synced 2026-06-17 15:05:39 +02:00
harden search parsing and qobuz refresh validation
This commit is contained in:
@@ -373,3 +373,15 @@ func qobuzSecretSig(requestTS, secret string) string {
|
||||
hash := md5.Sum([]byte(raw))
|
||||
return hex.EncodeToString(hash[:])
|
||||
}
|
||||
|
||||
func TestRefreshAppCredentialsRejectsEmptyData(t *testing.T) {
|
||||
d := config.DefaultConfigData()
|
||||
c := New(&config.Config{File: d, Session: d})
|
||||
c.fetchCfg = func(context.Context) (string, []string, error) {
|
||||
return "", []string{" "}, nil
|
||||
}
|
||||
err := c.refreshAppCredentials(context.Background(), &c.cfg.Session.Qobuz)
|
||||
if err == nil {
|
||||
t.Fatalf("expected error for empty refreshed app credentials")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user