1
0
Fork 0
mirror of synced 2024-07-05 22:40:39 +12:00

Update curl import to support encoded characters in request body

This commit is contained in:
Rory Powell 2021-12-21 09:39:34 -05:00
parent ff69aad969
commit ded3c2247b

View file

@ -17,8 +17,12 @@ const parseBody = (curl: any) => {
if (curl.data) {
const keys = Object.keys(curl.data)
if (keys.length) {
const key = keys[0]
let key = keys[0]
try {
// filter out the dollar syntax used by curl for shell support
if (key.startsWith("$")) {
key = key.substring(1)
}
return JSON.parse(key)
} catch (e) {
// do nothing