fix: add newline to response message in handleRequest
Ensure proper message formatting by adding a newline character to the response message before writing to the connection.
This commit is contained in:
2
main.go
2
main.go
@@ -72,7 +72,7 @@ func handleRequest(conn net.Conn) {
|
||||
} else {
|
||||
responseMsg = "error: unknown message"
|
||||
}
|
||||
if _, err := conn.Write([]byte(responseMsg)); err != nil {
|
||||
if _, err := conn.Write([]byte(responseMsg + "\n")); err != nil {
|
||||
postLog.Error(fmt.Sprintf("Failed to write: %v, err: %v", conn, err))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user