Skip Menu |

This queue is for tickets about the LWP-Authen-OAuth CPAN distribution.

Report information
The Basics
Id: 83101
Status: resolved
Priority: 0/
Queue: LWP-Authen-OAuth

People
Owner: Nobody in particular
Requestors: symkat [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



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; }
Fix applied in 1.02.