[ARVADOS] created: 64b837f87103a59efb6d4dac2b8dfa3c7c40c09a

Git user git at public.curoverse.com
Fri Aug 4 14:32:04 EDT 2017


        at  64b837f87103a59efb6d4dac2b8dfa3c7c40c09a (commit)


commit 64b837f87103a59efb6d4dac2b8dfa3c7c40c09a
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Aug 4 14:30:08 2017 -0400

    12078: Fix crash encoding booleans with libjson-perl 2.90.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curoverse.com>

diff --git a/sdk/perl/lib/Arvados/Request.pm b/sdk/perl/lib/Arvados/Request.pm
index 03d5428..4523f7d 100644
--- a/sdk/perl/lib/Arvados/Request.pm
+++ b/sdk/perl/lib/Arvados/Request.pm
@@ -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) {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list