Skip to content

Commit 8831c9d

Browse files
committed
curl fix
1 parent 1a29b99 commit 8831c9d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "restbro",
3-
"version": "1.0.10",
3+
"version": "1.0.11",
44
"description": "A modern API testing tool similar to Postman and Insomnia",
55
"main": "dist/main/main/index.js",
66
"scripts": {

src/main/modules/curl-executor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ export function parseCurlCommand(raw: string): CurlParsed {
5353
token === '--data-raw' ||
5454
token === '--data-binary'
5555
) {
56-
body = tokens[++i] || '';
56+
const data = tokens[++i] || '';
57+
body = body ? `${body}&${data}` : data;
5758
if (method === 'GET') method = 'POST';
5859
} else if (token === '--data-urlencode') {
59-
body = tokens[++i] || '';
60+
const data = tokens[++i] || '';
61+
body = body ? `${body}&${data}` : data;
6062
if (method === 'GET') method = 'POST';
6163
if (!headers['Content-Type']) {
6264
headers['Content-Type'] = 'application/x-www-form-urlencoded';

0 commit comments

Comments
 (0)