parent
c9b119f0a4
commit
9cbeddae8f
|
@ -4,6 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"html"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -123,7 +124,7 @@ func addToPlaylist(ds model.DataStore) http.HandlerFunc {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Must return an object with an ID, to satisfy ReactAdmin `create` call
|
// Must return an object with an ID, to satisfy ReactAdmin `create` call
|
||||||
_, err = w.Write([]byte(fmt.Sprintf(`{"id":"%s"}`, playlistId)))
|
_, err = fmt.Fprintf(w, `{"id":"%s"}`, html.EscapeString(playlistId))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue