- update https_get and https_post: now set headers for LWP / Crypt::SSLeay
authorplobbes <plobbes>
Thu, 22 Mar 2007 16:50:51 +0000 (16:50 +0000)
committerplobbes <plobbes>
Thu, 22 Mar 2007 16:50:51 +0000 (16:50 +0000)
OnlinePayment/HTTPS.pm

index ec01b70..3154297 100644 (file)
@@ -155,7 +155,10 @@ sub https_get {
           unless $self->port == 443;
         $url .= "/$path";
 
           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) );
 
         (
         my $res = $ua->request( GET($url) );
 
         (
@@ -258,6 +261,9 @@ sub https_post {
         }
 
         my $ua = new LWP::UserAgent;
         }
 
         my $ua = new LWP::UserAgent;
+        foreach my $hdr ( keys %headers ) {
+            $ua->default_header( $hdr => $headers{$hdr} );
+        }
 
         my $res;
         if ( ref($post_data) ) {
 
         my $res;
         if ( ref($post_data) ) {