Skip to content

Commit

Permalink
added a test for a malformed header, rather than tossing, just ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Jun 2, 2021
1 parent 0906a19 commit 6ddbcda
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nats-base-client/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,11 @@ export class MsgHdrsImpl implements MsgHdrs {
lines.slice(1).map((s) => {
if (s) {
const idx = s.indexOf(":");
const k = s.slice(0, idx);
const v = s.slice(idx + 1).trim();
mh.append(k, v);
if (idx > -1) {
const k = s.slice(0, idx);
const v = s.slice(idx + 1).trim();
mh.append(k, v);
}
}
});
}
Expand Down

0 comments on commit 6ddbcda

Please sign in to comment.