diff --git a/socketserver/internal/server/backlog.go b/socketserver/internal/server/backlog.go index 9b4f981f..6ced8141 100644 --- a/socketserver/internal/server/backlog.go +++ b/socketserver/internal/server/backlog.go @@ -366,7 +366,7 @@ func HBackendUpdateAndPublish(w http.ResponseWriter, r *http.Request) { cacheinfo, ok := ServerInitiatedCommands[cmd] if !ok { w.WriteHeader(422) - fmt.Fprintf(w, "Caching semantics unknown for command '%s'. Post to /addcachedcommand first.") + fmt.Fprintf(w, "Caching semantics unknown for command '%s'. Post to /addcachedcommand first.", cmd) return } diff --git a/socketserver/internal/server/commands.go b/socketserver/internal/server/commands.go index cd735d35..9594362e 100644 --- a/socketserver/internal/server/commands.go +++ b/socketserver/internal/server/commands.go @@ -203,10 +203,10 @@ func HandleSurvey(conn *websocket.Conn, client *ClientInfo, msg ClientMessage) ( } type FollowEvent struct { - User string `json:u` - Channel string `json:c` - NowFollowing bool `json:f` - Timestamp time.Time `json:t` + User string `json:"u"` + Channel string `json:"c"` + NowFollowing bool `json:"f"` + Timestamp time.Time `json:"t"` } var FollowEvents []FollowEvent diff --git a/socketserver/internal/server/types.go b/socketserver/internal/server/types.go index 48d3534d..7147bb1c 100644 --- a/socketserver/internal/server/types.go +++ b/socketserver/internal/server/types.go @@ -34,13 +34,13 @@ type ClientMessage struct { // Message ID. Increments by 1 for each message sent from the client. // When replying to a command, the message ID must be echoed. // When sending a server-initiated message, this is -1. - MessageID int `json:m` + MessageID int `json:"m"` // The command that the client wants from the server. // When sent from the server, the literal string 'True' indicates success. // Before sending, a blank Command will be converted into SuccessCommand. - Command Command `json:c` + Command Command `json:"c"` // Result of json.Unmarshal on the third field send from the client - Arguments interface{} `json:a` + Arguments interface{} `json:"a"` origArguments string }