added test for convertPmBodyResponse function

This commit is contained in:
Dhroov Gupta
2019-07-15 17:24:27 +05:30
parent 8ed1be2558
commit a9a8c24404
2 changed files with 31 additions and 2 deletions

View File

@@ -1164,10 +1164,12 @@ module.exports = {
if (responseBodyWrapper.contentTypeHeader) {
// we could infer the content-type header from the body
responseHeaders.push({ key: 'Content-Type', value: responseBodyWrapper.contentTypeHeader });
if (responseBodyWrapper.contentTypeHeader === APP_JSON) {
if (this.checkHeaderType(responseBodyWrapper.contentTypeHeader) &&
responseBodyWrapper.contentTypeHeader.endsWith('json')) {
previewLanguage = 'json';
}
else if (responseBodyWrapper.contentTypeHeader === APP_XML) {
else if (this.checkHeaderType(responseBodyWrapper.contentTypeHeader) &&
responseBodyWrapper.contentTypeHeader.endsWith('xml')) {
previewLanguage = 'xml';
}
}