Skip to content

Commit

Permalink
fix(HyperRequest): Only serializeJSON the body if the bodyFormat is json
Browse files Browse the repository at this point in the history
  • Loading branch information
elpete committed Dec 5, 2022
1 parent 5007f1f commit 4cc0eba
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions models/HyperRequest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 4cc0eba

Please sign in to comment.