Skip to content

Commit

Permalink
12078: Fix crash encoding booleans with libjson-perl 2.90.
Browse files Browse the repository at this point in the history
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <[email protected]>
  • Loading branch information
tomclegg committed Aug 4, 2017
1 parent a4ce464 commit 64b837f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sdk/perl/lib/Arvados/Request.pm
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ sub process_request
$self->{'req'} = new HTTP::Request (%req);
$self->{'req'}->header('Authorization' => ('OAuth2 ' . $self->{'authToken'})) if $self->{'authToken'};
$self->{'req'}->header('Accept' => 'application/json');

# allow_nonref lets us encode JSON::true and JSON::false, see #12078
my $json = JSON->new->allow_nonref;
my ($p, $v);
while (($p, $v) = each %{$self->{'queryParams'}}) {
$content{$p} = (ref($v) eq "") ? $v : JSON::encode_json($v);
$content{$p} = (ref($v) eq "") ? $v : $json->encode($v);
}
my $content;
while (($p, $v) = each %content) {
Expand Down

0 comments on commit 64b837f

Please sign in to comment.