Skip to content

Commit

Permalink
Only trim \r\n, not all spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
belak committed Jan 9, 2017
1 parent 352d84b commit 762af81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parser.go
Expand Up @@ -249,7 +249,7 @@ func MustParseMessage(line string) *Message {
// of invalid messages.
func ParseMessage(line string) (*Message, error) {
// Trim the line and make sure we have data
line = strings.TrimSpace(line)
line = strings.TrimRight(line, "\r\n")
if len(line) == 0 {
return nil, ErrZeroLengthMessage
}
Expand Down

0 comments on commit 762af81

Please sign in to comment.