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( getHoppReqHeaders(item).find(
({ key }) => key.toLowerCase() === "content-type" ({ key }) => key.toLowerCase() === "content-type"
)?.value ?? )?.value ??
PMRawLanguageOptionsToContentTypeMap[ get(
PMRawLanguageOptionsToContentTypeMap,
get(body, "options.raw.language", "text") as PMRawLanguage get(body, "options.raw.language", "text") as PMRawLanguage
] )
if (body.raw !== undefined && body.raw !== null) if (contentType && body.raw !== undefined && body.raw !== null)
return { return {
contentType: contentType as any, contentType: contentType as any,
body: replacePMVarTemplating(body.raw), body: replacePMVarTemplating(body.raw),