Skip to content

Commit

Permalink
Fix compatibility with JSON <4 (specifically perl-JSON-2.59-2.el7)
Browse files Browse the repository at this point in the history
hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this) at .../Tesla/API.pm line 124.
  • Loading branch information
jankratochvil committed Apr 1, 2022
1 parent 9e08882 commit 5ce76fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Tesla/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ sub api {
push @$header, 'Authorization' => $token_string;
}

my $request = HTTP::Request->new($type, $url, $header, encode_json($api_params));
my $request = HTTP::Request->new($type, $url, $header, JSON->new->allow_nonref->encode($api_params));

my $response = $self->mech->request($request);

Expand Down

0 comments on commit 5ce76fa

Please sign in to comment.