refactor: handle unknown raw language option

This commit is contained in:
Rishabh Agarwal
2022-03-18 16:59:45 +05:30
committed by Andrew Bastin
parent 01764dbb8b
commit 86803dc2be

View File

@@ -200,11 +200,12 @@ const getHoppReqBody = (item: Item): HoppRESTReqBody => {
getHoppReqHeaders(item).find(
({ key }) => key.toLowerCase() === "content-type"
)?.value ??
PMRawLanguageOptionsToContentTypeMap[
get(
PMRawLanguageOptionsToContentTypeMap,
get(body, "options.raw.language", "text") as PMRawLanguage
]
)
if (body.raw !== undefined && body.raw !== null)
if (contentType && body.raw !== undefined && body.raw !== null)
return {
contentType: contentType as any,
body: replacePMVarTemplating(body.raw),