Commit f41727ca authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Send server sent events as JSON like the other server APIs

parent 344ded3a
......@@ -2,6 +2,7 @@ package servercore
import (
"encoding/json"
"fmt"
"net/http"
"reflect"
"time"
......@@ -34,7 +35,8 @@ func (session *session) onUpdate() {
if session.evtSource != nil {
session.conf.Logger.WithFields(logrus.Fields{"session": session.token, "status": session.status}).
Debug("Sending status to SSE listeners")
session.evtSource.SendEventMessage(string(session.status), "", "")
// We send JSON like the other APIs, so quote
session.evtSource.SendEventMessage(fmt.Sprintf(`"%s"`, session.status), "", "")
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment