Merge pull request #10 from nogoegst/trim-nl-before-the-dot

Trim trailing CRLF from dot-encoded data
This commit is contained in:
Yawning Angel 2017-04-05 03:35:06 +00:00 committed by GitHub
commit 85d80d893c
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ func (c *Conn) ReadResponse() (*Response, error) {
if c.debugLog {
log.Printf("S: [dot encoded data]")
}
resp.Data = append(resp.Data, string(dotBody))
resp.Data = append(resp.Data, strings.TrimRight(string(dotBody), "\n\r"))
dotLines := strings.Split(string(dotBody), "\n")
for _, dotLine := range dotLines[:len(dotLines)-1] {
resp.RawLines = append(resp.RawLines, dotLine)