mirror of
https://github.com/navidrome/navidrome.git
synced 2025-08-10 00:52:20 +00:00
Small fixes to response marshaling, introduced tests for response formats
This commit is contained in:
@@ -30,10 +30,7 @@ func (c *BaseAPIController) SendError(errorCode int, message ...interface{}) {
|
||||
func (c *BaseAPIController) SendResponse(response responses.Subsonic) {
|
||||
f := c.GetString("f")
|
||||
if f == "json" {
|
||||
type jsonWrapper struct {
|
||||
Subsonic responses.Subsonic `json:"subsonic-response"`
|
||||
}
|
||||
w := &jsonWrapper{Subsonic: response}
|
||||
w := &responses.JsonWrapper{Subsonic: response}
|
||||
c.Data["json"] = &w
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user