feat: add server name and version to all responses

This is inline with other Subsonic compatible servers, like funkwhale, madsonic, ampache...
This commit is contained in:
Deluan
2020-01-30 14:43:24 -05:00
parent 482350c076
commit 90a1e6d213
47 changed files with 76 additions and 71 deletions
+2 -1
View File
@@ -151,11 +151,12 @@ func HGone(r chi.Router, path string) {
}
func SendError(w http.ResponseWriter, r *http.Request, err error) {
response := &responses.Subsonic{Version: Version, Status: "fail"}
response := NewResponse()
code := responses.ErrorGeneric
if e, ok := err.(SubsonicError); ok {
code = e.code
}
response.Status = "fail"
response.Error = &responses.Error{Code: code, Message: err.Error()}
SendResponse(w, r, response)