add licence

This commit is contained in:
sentriz
2019-04-11 18:27:45 +01:00
parent ec53d04730
commit 76ad2ec4eb
25 changed files with 2978 additions and 20 deletions

View File

@@ -27,6 +27,7 @@ func respondRaw(w http.ResponseWriter, r *http.Request, code int, sub *subsonic.
w.Write([]byte(`{"subsonic-response":`))
w.Write(data)
w.Write([]byte("}"))
fmt.Println("THE JSON", string(data))
case "jsonp":
w.Header().Set("Content-Type", "application/javascript")
data, err := json.Marshal(sub)
@@ -37,6 +38,7 @@ func respondRaw(w http.ResponseWriter, r *http.Request, code int, sub *subsonic.
w.Write([]byte(fmt.Sprintf(`%s({"subsonic-response":`, callback)))
w.Write(data)
w.Write([]byte("});"))
fmt.Println("THE JSONP", string(data))
default:
w.Header().Set("Content-Type", "application/xml")
data, err := xml.Marshal(sub)
@@ -44,6 +46,7 @@ func respondRaw(w http.ResponseWriter, r *http.Request, code int, sub *subsonic.
log.Printf("could not marshall to xml: %v\n", err)
}
w.Write(data)
fmt.Println("THE XML", string(data))
}
}