Prevent curl copy from using stale body data

https://feedback.yaak.app/p/copy-as-curl-includes-wrong-data-property
This commit is contained in:
Gregory Schier
2025-08-02 10:03:35 -07:00
parent 0e28079965
commit 8b84545b67
2 changed files with 26 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ describe('exporter-curl', () => {
],
}),
).toEqual(
[`curl 'https://yaak.app/?a=aaa&b=bbb'`].join(` \\n `),
[`curl 'https://yaak.app?a=aaa&b=bbb'`].join(` \\n `),
);
});
@@ -218,4 +218,16 @@ describe('exporter-curl', () => {
}),
).toEqual([`curl 'https://yaak.app'`, `--header 'Authorization: Bearer '`].join(` \\\n `));
});
});
test('Stale body data', async () => {
expect(
await convertToCurl({
url: 'https://yaak.app',
bodyType: 'none',
body: {
text: 'ignore me',
}
}),
).toEqual([`curl 'https://yaak.app'`].join(` \\\n `));
});
});