🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Supporting "jsonp" format
Deluan3ab09c4b2c24
diff --git a/api/base_api_controller.go b/api/base_api_controller.goindex f213854bf..9dd5f6fef 100644--- a/api/base_api_controller.go+++ b/api/base_api_controller.go@@ -29,11 +29,16 @@ func (c *BaseAPIController) SendError(errorCode int, message ...interface{}) {func (c *BaseAPIController) SendResponse(response responses.Subsonic) {f := c.GetString("f")- if f == "json" {+ switch f {+ case "json":w := &responses.JsonWrapper{Subsonic: response}c.Data["json"] = &wc.ServeJSON()- } else {+ case "jsonp":+ w := &responses.JsonWrapper{Subsonic: response}+ c.Data["jsonp"] = &w+ c.ServeJSONP()+ default:c.Data["xml"] = &responsec.ServeXML()}