mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-24 06:28:42 +01:00
fix: cleans up reading messages when headers are invalid (#2424)
This commit is contained in:
@@ -125,7 +125,8 @@ func readEvent(reader *bufio.Reader, tty bool) (string, StdType, error) {
|
|||||||
return "", streamType, err
|
return "", streamType, err
|
||||||
}
|
}
|
||||||
if n != 8 {
|
if n != 8 {
|
||||||
return "", streamType, ErrBadHeader
|
message, _ := reader.ReadString('\n')
|
||||||
|
return message, streamType, ErrBadHeader
|
||||||
}
|
}
|
||||||
|
|
||||||
switch header[0] {
|
switch header[0] {
|
||||||
@@ -134,7 +135,8 @@ func readEvent(reader *bufio.Reader, tty bool) (string, StdType, error) {
|
|||||||
case 2:
|
case 2:
|
||||||
streamType = STDERR
|
streamType = STDERR
|
||||||
default:
|
default:
|
||||||
return "", streamType, ErrBadHeader
|
message, _ := reader.ReadString('\n')
|
||||||
|
return message, streamType, ErrBadHeader
|
||||||
}
|
}
|
||||||
|
|
||||||
count := binary.BigEndian.Uint32(header[4:])
|
count := binary.BigEndian.Uint32(header[4:])
|
||||||
|
|||||||
Reference in New Issue
Block a user