You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2022/03/01 22:21:01 UTC

[thrift] branch master updated: Fix headers bug in Thrift/HttpClient.pm

This is an automated email from the ASF dual-hosted git repository.

jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new 8ab86c3  Fix headers bug in Thrift/HttpClient.pm
8ab86c3 is described below

commit 8ab86c3303a8157ecfed6ff588d71e6e13dd7017
Author: Finn Colman <fi...@modicagroup.com>
AuthorDate: Tue Mar 1 15:59:34 2022 +1300

    Fix headers bug in Thrift/HttpClient.pm
---
 lib/perl/lib/Thrift/HttpClient.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/perl/lib/Thrift/HttpClient.pm b/lib/perl/lib/Thrift/HttpClient.pm
index 40ec9ce..3513a08 100644
--- a/lib/perl/lib/Thrift/HttpClient.pm
+++ b/lib/perl/lib/Thrift/HttpClient.pm
@@ -186,7 +186,8 @@ sub flush
     $out->setpos(0); # rewind
     my $buf = join('', <$out>);
 
-    my $request = HTTP::Request->new(POST => $self->{url}, ($self->{headers} || undef), $buf);
+    my $request = HTTP::Request->new(POST => $self->{url}, undef, $buf);
+    map { $request->header($_ => $self->{headers}->{$_}) } keys %{$self->{headers}};
     my $response = $ua->request($request);
     my $content_ref = $response->content_ref;