Update api.ws log messages

This commit is contained in:
Alex X
2024-05-13 07:00:51 +03:00
parent 5889791847
commit c950bb0252
+2 -2
View File
@@ -83,7 +83,7 @@ func initWS(origin string) {
if o.Host == r.Host { if o.Host == r.Host {
return true return true
} }
log.Trace().Msgf("[api.ws] origin=%s, host=%s", o.Host, r.Host) log.Trace().Msgf("[api] ws origin=%s, host=%s", o.Host, r.Host)
// https://github.com/AlexxIT/go2rtc/issues/118 // https://github.com/AlexxIT/go2rtc/issues/118
if i := strings.IndexByte(o.Host, ':'); i > 0 { if i := strings.IndexByte(o.Host, ':'); i > 0 {
return o.Host[:i] == r.Host return o.Host[:i] == r.Host
@@ -127,7 +127,7 @@ func apiWS(w http.ResponseWriter, r *http.Request) {
break break
} }
log.Trace().Str("type", msg.Type).Msg("[api.ws] msg") log.Trace().Str("type", msg.Type).Msg("[api] ws msg")
if handler := wsHandlers[msg.Type]; handler != nil { if handler := wsHandlers[msg.Type]; handler != nil {
go func() { go func() {