diff --git a/packages/bruno-app/src/utils/curl/content-type.js b/packages/bruno-app/src/utils/curl/content-type.js index 0a1e54610..110bb02fd 100644 --- a/packages/bruno-app/src/utils/curl/content-type.js +++ b/packages/bruno-app/src/utils/curl/content-type.js @@ -6,6 +6,11 @@ const normalizeContentType = (contentType) => { return contentType.toLowerCase(); }; +export const isNDJsonLikeContentType = (contentType) => { + const normalized = normalizeContentType(contentType); + return normalized.includes('application/x-ndjson') || normalized.includes('application/ndjson'); +}; + export const isJsonLikeContentType = (contentType) => { const normalized = normalizeContentType(contentType); @@ -25,5 +30,5 @@ export const isPlainTextContentType = (contentType) => { }; export const isStructuredContentType = (contentType) => { - return isJsonLikeContentType(contentType) || isXmlLikeContentType(contentType) || isPlainTextContentType(contentType); + return isNDJsonLikeContentType(contentType) || isJsonLikeContentType(contentType) || isXmlLikeContentType(contentType) || isPlainTextContentType(contentType); }; diff --git a/packages/bruno-app/src/utils/curl/index.js b/packages/bruno-app/src/utils/curl/index.js index f288fccc8..064c5851c 100644 --- a/packages/bruno-app/src/utils/curl/index.js +++ b/packages/bruno-app/src/utils/curl/index.js @@ -65,6 +65,9 @@ export const getRequestFromCurlCommand = (curlCommand, requestType = 'http-reque if (requestType === 'graphql-request' && (isJsonLikeContentType(contentType) || normalizedContentType.includes('application/graphql'))) { body.mode = 'graphql'; body.graphql = parseGraphQL(parsedBody); + } else if (normalizedContentType.includes('application/x-ndjson') || normalizedContentType.includes('application/ndjson')) { + body.mode = 'text'; + body.text = parsedBody; } else if (requestType === 'http-request' && request.isDataBinary) { body.mode = 'file'; body.file = parsedBody;