- update https_get and https_post: now set headers for LWP / Crypt::SSLeay
[Business-OnlinePayment.git] / OnlinePayment / HTTPS.pm
index 1a86a1b..3154297 100644 (file)
@@ -6,8 +6,7 @@ use URI::Escape;
 use Tie::IxHash;
 use base qw(Business::OnlinePayment);
 
-$VERSION = '0.05_01';
-$VERSION = eval $VERSION;    # modperlstyle: convert the string into a number
+$VERSION = '0.05';
 $DEBUG   = 0;
 
 BEGIN {
@@ -156,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) );
 
         (
@@ -259,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) ) {