Skip to content

Commit dafbc35

Browse files
committedApr 8, 2020
fix: json parser error for top level JSON values
fixes: pact-foundation/pact-net#237
1 parent e5ba92a commit dafbc35

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎lib/pact/provider/test_methods.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def replay_interaction interaction, request_customizer = nil
2929
def parse_body_from_response rack_response
3030
case rack_response.headers['Content-Type']
3131
when /json/
32-
JSON.load(rack_response.body)
32+
# For https://github.com/pact-foundation/pact-net/issues/237
33+
# Only required for the pact-ruby-standalone ¯\_(ツ)_/¯
34+
JSON.load("[#{rack_response.body}]").first
3335
else
3436
rack_response.body
3537
end

0 commit comments

Comments
 (0)