Skip to content

Commit 946f094

Browse files
committed
🐛 Sort body to match signatures.
1 parent efd4ea9 commit 946f094

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/run.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ function buildOpts(body, cliOpts) {
7777
if (isJsonString(cliOpts.headers)) {
7878
opts.body = body
7979
} else {
80-
opts.body = JSON.stringify(loadJsonOrYaml(body))
80+
const bodyObj = loadJsonOrYaml(body)
81+
const sortedBodyObj = Object.keys(bodyObj).sort().reduce((ret, key) => {
82+
ret[key] = bodyObj[key];
83+
return ret;
84+
}, {});
85+
opts.body = JSON.stringify(sortedBodyObj)
8186
}
8287
}
8388
if (cliOpts?.debug) {

0 commit comments

Comments
 (0)