Skip to content

Commit 7492019

Browse files
authored
avoid modifying header value when parsing corresponding CLI argument (#104)
1 parent 20c5765 commit 7492019

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/command.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ class GraphqurlCommand extends Command {
8080
if (headersArray) {
8181
for (let h of headersArray) {
8282
const parts = h.split(':');
83-
if (parts.length !== 2) {
84-
this.error(`cannot parse header '${h}' (multiple ':')`);
83+
if (parts.length < 2) {
84+
this.error(`cannot parse header '${h}' (no ':')`);
8585
}
86-
headerObject[parts[0].trim()] = parts[1].trim();
86+
const headerName = parts.splice(0, 1)[0].trim();
87+
headerObject[headerName] = parts.join(':').trimLeft();
8788
}
8889
}
8990
return headerObject;

0 commit comments

Comments
 (0)