Skip to content

Commit

Permalink
added space after ':' in header separator (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Oct 9, 2020
1 parent e7c566e commit 9c32aec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nats-base-client/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function headers(): MsgHdrs {

export class MsgHdrsImpl implements MsgHdrs {
static CRLF = "\r\n";
static SEP = ":";
static SEP = ": ";
static HEADER = "NATS/1.0";
error?: number;
headers: Map<string, string[]> = new Map();
Expand Down Expand Up @@ -88,7 +88,7 @@ export class MsgHdrsImpl implements MsgHdrs {
if (s) {
const idx = s.indexOf(MsgHdrsImpl.SEP);
const k = s.slice(0, idx);
const v = s.slice(idx + 1);
const v = s.slice(idx + 2);
mh.append(k, v);
}
});
Expand All @@ -103,7 +103,7 @@ export class MsgHdrsImpl implements MsgHdrs {
let s = MsgHdrsImpl.HEADER;
for (const [k, v] of this.headers) {
for (let i = 0; i < v.length; i++) {
s = `${s}\r\n${k}:${v[i]}`;
s = `${s}\r\n${k}: ${v[i]}`;
}
}
return `${s}\r\n\r\n`;
Expand Down

0 comments on commit 9c32aec

Please sign in to comment.