Hi!
First of all, thank you for this great module; I've found it extremely useful while working with
OAuth APIs. =)
There is a small bug in the way the constructer handles the accessors that you've added. LWP
will emit an error when an unrecognized argument is passed to it and global warnings are
enabled through ^W/-w.
$ perl -w -MLWP::Authen::OAuth -e'LWP::Authen::OAuth->new( oauth_consumer_key => "foo"
);'
Unrecognized LWP::UserAgent options: oauth_consumer_key at -e line 1.
The included patch moves the oauth specific keys into a hash before SUPER::new is called, and
then adds the keys to the object.
Subject: | oauth.patch |
--- /home/symkat/perl5/lib/perl5/LWP/Authen/OAuth.pm 2011-03-31 06:52:21.000000000 -0400
+++ OAuth.pm 2013-02-02 11:12:54.000000000 -0500
@@ -178,13 +178,15 @@
sub new
{
my( $class, %self ) = @_;
-
- my $self = $class->SUPER::new( %self );
+ my %oauth_params;
for(qw( oauth_consumer_key oauth_consumer_secret oauth_token oauth_token_secret ))
{
- $self->{$_} = $self{$_};
+ $oauth_params{$_} = delete $self{$_};
}
+
+ my $self = $class->SUPER::new( %self );
+ $self->{$_} = $oauth_params{$_} for keys %oauth_params;
return $self;
}