fmt=json on websocket
This commit is contained in:
parent
f66e07e873
commit
647701822c
1 changed files with 9 additions and 1 deletions
|
@ -118,10 +118,18 @@ func getWSHandler(hub circolog.Hub) http.HandlerFunc {
|
|||
WriteBufferSize: 1024,
|
||||
}
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
render_opts, err := parseRenderParameters(r)
|
||||
if err != nil {
|
||||
log.Println("Error parsing:", err)
|
||||
w.WriteHeader(400)
|
||||
fmt.Fprintln(w, err)
|
||||
return
|
||||
}
|
||||
opts, err := parseParameters(r)
|
||||
if err != nil {
|
||||
log.Println("Error on request parameter \"l\":", err)
|
||||
w.WriteHeader(400)
|
||||
fmt.Fprintln(w, err)
|
||||
return
|
||||
}
|
||||
opts.Nofollow = false
|
||||
|
@ -156,7 +164,7 @@ func getWSHandler(hub circolog.Hub) http.HandlerFunc {
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
writeFormatted(w, formatSyslog, message)
|
||||
writeFormatted(w, render_opts.Format, message)
|
||||
|
||||
if err := w.Close(); err != nil {
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue