Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/SyTest/HTTPServer/Request.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ use constant JSON_MIME_TYPE => "application/json";

use SyTest::CarpByFile;

use SyTest::HTTPClient;

sub DESTROY
{
return if ${^GLOBAL_PHASE} eq "DESTRUCT";
Expand All @@ -33,7 +35,13 @@ sub body_from_json
croak "Cannot ->body_from_json with Content-Type: $type";
}

return $json->decode( $self->body );
my $decoded = $json->decode( $self->body );

# wrap numeric values with JSON::number to stop them getting turned into
# strings when they are printed.
$decoded = SyTest::HTTPClient::wrap_numbers( $decoded );

return $decoded;
}

sub respond_json
Expand Down