From ded3c2247b818494ff20b201d3c280f650a61776 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Tue, 21 Dec 2021 09:39:34 -0500 Subject: [PATCH] Update curl import to support encoded characters in request body --- .../server/src/api/controllers/query/import/sources/curl.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/query/import/sources/curl.ts b/packages/server/src/api/controllers/query/import/sources/curl.ts index 61e1ae0215..b55d24403b 100644 --- a/packages/server/src/api/controllers/query/import/sources/curl.ts +++ b/packages/server/src/api/controllers/query/import/sources/curl.ts @@ -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