Add active publish logic to streams

This commit is contained in:
Alex X
2023-09-17 20:29:28 +03:00
parent dca8279e0c
commit 209fe09806
3 changed files with 45 additions and 0 deletions

View File

@@ -172,6 +172,10 @@ func streamsHandler(w http.ResponseWriter, r *http.Request) {
} else {
api.ResponseJSON(w, stream)
}
} else if stream = Get(src); stream != nil {
if err := stream.Publish(dst); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
} else {
http.Error(w, "", http.StatusNotFound)
}