responderror auto sprintf

This commit is contained in:
sentriz
2019-05-28 15:07:58 +01:00
parent 74c55bd509
commit e7ed19abd9
5 changed files with 13 additions and 18 deletions

View File

@@ -55,14 +55,13 @@ func (c *Controller) WithValidSubsonicArgs(next http.HandlerFunc) http.HandlerFu
passwordAuth, tokenAuth := token == "" && salt == "",
password == ""
if tokenAuth == passwordAuth {
respondError(w, r,
10, "please provide parameters `t` and `s`, or just `p`",
)
respondError(w, r, 10,
"please provide parameters `t` and `s`, or just `p`")
return
}
user := c.GetUserFromName(username)
if user == nil {
respondError(w, r, 40, "invalid username")
respondError(w, r, 40, "invalid username `%s`", username)
return
}
var credsOk bool