cho45 (owner)

Revisions

gist: 198661 Download_button fork
public
Public Clone URL: git://gist.github.com/198661.git
Embed All Files: show embed
xml-atom-addtional-http-headers.patch #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/lib/XML/Atom/Client.pm b/lib/XML/Atom/Client.pm
index 8320ad1..5f1e1fe 100644
--- a/lib/XML/Atom/Client.pm
+++ b/lib/XML/Atom/Client.pm
@@ -25,6 +25,7 @@ sub new {
 sub init {
     my $client = shift;
     my %param = @_;
+ $client->{headers} = delete $param{headers} || [];
     $client->{ua} = LWP::UserAgent::AtomClient->new($client);
     $client->{ua}->agent('XML::Atom/' . XML::Atom->VERSION);
     $client->{ua}->parse_head(0);
@@ -180,6 +181,12 @@ SOAP
             $req->header('Authorization', 'WSSE profile="UsernameToken"');
         }
     }
+
+ my $headers = [ @{ $client->{headers} } ];
+
+ while (my ($key, $value) = splice @$headers, 0, 2) {
+ $req->header($key => $value);
+ }
 }
 
 sub munge_response {