fix: plain text curl data (#3677)

This commit is contained in:
pooja-bruno 2024-12-23 17:29:06 +05:30 committed by GitHub
parent f871bc0fa2
commit f8711a91d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,7 +57,7 @@ function getDataString(request) {
console.error('Failed to parse JSON data:', error);
return { data: request.data.toString() };
}
} else if (contentType && contentType.includes('application/xml')) {
} else if (contentType && (contentType.includes('application/xml') || contentType.includes('text/plain'))) {
return { data: request.data };
}
@ -174,14 +174,14 @@ const curlToJson = (curlCommand) => {
}
if (request.auth) {
if(request.auth.mode === 'basic'){
if (request.auth.mode === 'basic') {
requestJson.auth = {
mode: 'basic',
basic: {
username: repr(request.auth.basic?.username),
password: repr(request.auth.basic?.password)
}
}
};
}
}