From 539664e913f52544a705dcbdaee19c8ef10d38e7 Mon Sep 17 00:00:00 2001 From: plobbes Date: Thu, 22 Mar 2007 16:50:51 +0000 Subject: [PATCH] - update https_get and https_post: now set headers for LWP / Crypt::SSLeay --- OnlinePayment/HTTPS.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OnlinePayment/HTTPS.pm b/OnlinePayment/HTTPS.pm index ec01b70..3154297 100644 --- a/OnlinePayment/HTTPS.pm +++ b/OnlinePayment/HTTPS.pm @@ -155,7 +155,10 @@ sub https_get { unless $self->port == 443; $url .= "/$path"; - my $ua = new LWP::UserAgent; + my $ua = new LWP::UserAgent; + foreach my $hdr ( keys %headers ) { + $ua->default_header( $hdr => $headers{$hdr} ); + } my $res = $ua->request( GET($url) ); ( @@ -258,6 +261,9 @@ sub https_post { } my $ua = new LWP::UserAgent; + foreach my $hdr ( keys %headers ) { + $ua->default_header( $hdr => $headers{$hdr} ); + } my $res; if ( ref($post_data) ) { -- 2.11.0