Skip to content

Commit

Permalink
fix: more missing responses
Browse files Browse the repository at this point in the history
trim() removed spaces causing incorrect processing of chunked messages
where a space was at the end of the chunk
  • Loading branch information
ianshade committed Apr 22, 2021
1 parent d86e571 commit 330a327
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/peptalk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ class PepTalk extends EventEmitter implements PepTalkClient, PepTalkJS {
}

private processChunk(m: string): void {
let split = m.trim().split('\r\n')
let split = m.replace(/^\r\n|\r\n$/g, '').split('\r\n')
if (split.length === 0) return
const re = /\{(\d+)\}/g
const last = split[split.length - 1]
Expand Down

0 comments on commit 330a327

Please sign in to comment.