From 4cc0eba6f9d0a9ab3bd33fa2ff2385b065b3815c Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Mon, 5 Dec 2022 13:45:20 -0700 Subject: [PATCH] fix(HyperRequest): Only serializeJSON the body if the bodyFormat is json --- models/HyperRequest.cfc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/models/HyperRequest.cfc b/models/HyperRequest.cfc index b6207db..58f0d44 100644 --- a/models/HyperRequest.cfc +++ b/models/HyperRequest.cfc @@ -1052,11 +1052,8 @@ component accessors="true" { * * @returns A simple value representing the body. */ - public string function prepareBody() { - if ( isSimpleValue( getBody() ) ) { - return getBody(); - } - return serializeJSON( getBody() ); + public any function prepareBody() { + return getBodyFormat() == "json" ? serializeJSON( getBody() ) : getBody(); } public struct function getMemento() {