@@ -292,12 +292,19 @@ var self = module.exports = {
292292 * @returns {Boolean }
293293 */
294294 shouldAddHttpMethod : function ( request , options ) {
295- const followRedirect = _ . get ( request , 'protocolProfileBehavior.followRedirects' , options . followRedirect ) ,
296- followOriginalHttpMethod =
297- _ . get ( request , 'protocolProfileBehavior.followOriginalHttpMethod' , options . followOriginalHttpMethod ) ,
298- disableBodyPruning = _ . get ( request , 'protocolProfileBehavior.disableBodyPruning' , true ) ,
295+ let followRedirect = options . followRedirect ,
296+ followOriginalHttpMethod = options . followOriginalHttpMethod ,
297+ disableBodyPruning = true ,
299298 isBodyEmpty = self . isBodyEmpty ( request . body ) ;
300299
300+ // eslint-disable-next-line lodash/prefer-is-nil
301+ if ( request . protocolProfileBehavior !== null && request . protocolProfileBehavior !== undefined ) {
302+ followRedirect = _ . get ( request , 'protocolProfileBehavior.followRedirects' , followRedirect ) ;
303+ followOriginalHttpMethod =
304+ _ . get ( request , 'protocolProfileBehavior.followOriginalHttpMethod' , followOriginalHttpMethod ) ;
305+ disableBodyPruning = _ . get ( request , 'protocolProfileBehavior.disableBodyPruning' , true ) ;
306+ }
307+
301308 if ( followRedirect && followOriginalHttpMethod ) {
302309 return true ;
303310 }
0 commit comments