Fixed issue where disableBodyPruning option was not set to true for requests like GET, HEAD etc. with no request body

This commit is contained in:
Vishal Shingala
2022-07-13 18:59:38 +05:30
parent 683a169a4f
commit 3f271b72cd
2 changed files with 26 additions and 4 deletions

View File

@@ -2454,9 +2454,6 @@ module.exports = {
pmBody = this.convertToPmBody(reqBody, REQUEST_TYPE.ROOT, components, options, schemaCache);
item.request.body = pmBody.body;
// Following is added to make sure body pruning for request methods like GET, HEAD etc is disabled'.
item.protocolProfileBehavior = { disableBodyPruning: true };
if (!options.keepImplicitHeaders || (!_.find(reqParams.header, (h) => {
return _.toLower(_.get(h, 'name')) === 'content-type';
}))) {
@@ -2568,6 +2565,13 @@ module.exports = {
if (!_.isEmpty(acceptHeader) && !item.request.headers.has('accept')) {
item.request.addHeader(acceptHeader);
}
/**
* Following is added to make sure body pruning for request methods like GET, HEAD etc is disabled'.
* https://github.com/postmanlabs/postman-runtime/blob/develop/docs/protocol-profile-behavior.md
*/
item.protocolProfileBehavior = { disableBodyPruning: true };
return item;
},