From d26e5208fe66a06299282e57bdf9e3af549f298f Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Thu, 3 Jun 2021 15:52:38 +1000 Subject: [PATCH] fix: check for nil body rather than falsey body when determining how to render mocked response Fixes: https://github.com/pact-foundation/pact-mock_service/issues/99 --- lib/pact/mock_service/request_handlers/interaction_replay.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pact/mock_service/request_handlers/interaction_replay.rb b/lib/pact/mock_service/request_handlers/interaction_replay.rb index 0e201d3..ab0a2ce 100644 --- a/lib/pact/mock_service/request_handlers/interaction_replay.rb +++ b/lib/pact/mock_service/request_handlers/interaction_replay.rb @@ -182,7 +182,7 @@ def self.response_from response end def self.render_body body - return '' unless body + return '' if body.nil? body.kind_of?(String) ? body.force_encoding('utf-8') : body.to_json end end