Fixed CORS

This commit is contained in:
2020-11-30 21:22:51 +01:00
parent ebaa93b1ea
commit b24c9dca3c
5 changed files with 22 additions and 12 deletions

View File

@@ -163,6 +163,7 @@ func getPreviousSong() string {
}
func musicHandler(w http.ResponseWriter, r *http.Request) {
(w).Header().Set("Access-Control-Allow-Origin", "*")
if r.URL.Path == "/music" && r.Method == http.MethodGet {
song := r.URL.Query().Get("song")
if song == "" {