1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 21:33:18 +01:00

fix: cleans up reading messages when headers are invalid (#2424)

This commit is contained in:
Amir Raminfar
2023-10-16 09:26:27 -07:00
committed by GitHub
parent 4f748bf9e1
commit 37c6033371

View File

@@ -125,7 +125,8 @@ func readEvent(reader *bufio.Reader, tty bool) (string, StdType, error) {
return "", streamType, err
}
if n != 8 {
return "", streamType, ErrBadHeader
message, _ := reader.ReadString('\n')
return message, streamType, ErrBadHeader
}
switch header[0] {
@@ -134,7 +135,8 @@ func readEvent(reader *bufio.Reader, tty bool) (string, StdType, error) {
case 2:
streamType = STDERR
default:
return "", streamType, ErrBadHeader
message, _ := reader.ReadString('\n')
return message, streamType, ErrBadHeader
}
count := binary.BigEndian.Uint32(header[4:])