diff -Nru libnet-facebook-oauth2-perl-0.07/Changes libnet-facebook-oauth2-perl-0.08/Changes --- libnet-facebook-oauth2-perl-0.07/Changes 2013-08-21 20:24:59.000000000 +0000 +++ libnet-facebook-oauth2-perl-0.08/Changes 2013-10-10 13:39:23.000000000 +0000 @@ -1,18 +1,22 @@ -Revision history for Perl extension Net::Facebook::Oauth2. +Revision history for Perl module Net::Facebook::Oauth2. -0.02 Thu Jul 29 3:00:39 2010 - - Fixed some methods - - Added better documentations - - Added more examples +0.08 2013 2013-10-10 + - Bug fix reported by Emad Fanous, adding query to already existing one + - Update Changes File -0.03 Sat Sep 01 16:00:00 2012 - - Fixed some bugs - - Fixed documentations and examples - - Added more examples +0.07 2013 2013-08-21 + - Updating MANIFEST file to include examples folder -0.06 Mon May 28 16:00:00 2013 +0.06 2013-05-28 - Allow Browser options to pass in by & tests (William Bellamy) - Changed behavior to access_token & tests by (Takatsugu Shigeta) -0.07 Wed Aug 21 16:00:00 2013 - - Updating MANIFEST file to include examples folder +0.03 2012 2012-09-01 + - Fixed some bugs + - Fixed documentations and examples + - Added more examples + +0.02 2010-07-29 + - Fixed some methods + - Added better documentations + - Added more examples diff -Nru libnet-facebook-oauth2-perl-0.07/META.json libnet-facebook-oauth2-perl-0.08/META.json --- libnet-facebook-oauth2-perl-0.07/META.json 2013-08-21 20:32:22.000000000 +0000 +++ libnet-facebook-oauth2-perl-0.08/META.json 2013-10-10 13:39:53.000000000 +0000 @@ -41,5 +41,5 @@ } }, "release_status" : "stable", - "version" : "0.07" + "version" : "0.08" } diff -Nru libnet-facebook-oauth2-perl-0.07/META.yml libnet-facebook-oauth2-perl-0.08/META.yml --- libnet-facebook-oauth2-perl-0.07/META.yml 2013-08-21 20:32:17.000000000 +0000 +++ libnet-facebook-oauth2-perl-0.08/META.yml 2013-10-10 13:39:50.000000000 +0000 @@ -23,4 +23,4 @@ JSON::Any: 0 LWP::UserAgent: 0 URI::Escape: 0 -version: 0.07 +version: 0.08 diff -Nru libnet-facebook-oauth2-perl-0.07/debian/changelog libnet-facebook-oauth2-perl-0.08/debian/changelog --- libnet-facebook-oauth2-perl-0.07/debian/changelog 2013-10-04 20:37:48.000000000 +0000 +++ libnet-facebook-oauth2-perl-0.08/debian/changelog 2013-10-31 15:42:14.000000000 +0000 @@ -1,3 +1,10 @@ +libnet-facebook-oauth2-perl (0.08-1) unstable; urgency=low + + * Imported Upstream version 0.08 + * Bump Standards-Version to 3.9.5 (no changes) + + -- Xavier Guimard Thu, 31 Oct 2013 06:22:40 +0100 + libnet-facebook-oauth2-perl (0.07-1) unstable; urgency=low * Initial Release (Closes: #725341) diff -Nru libnet-facebook-oauth2-perl-0.07/debian/control libnet-facebook-oauth2-perl-0.08/debian/control --- libnet-facebook-oauth2-perl-0.07/debian/control 2013-10-04 20:37:48.000000000 +0000 +++ libnet-facebook-oauth2-perl-0.08/debian/control 2013-10-31 15:42:14.000000000 +0000 @@ -13,7 +13,7 @@ liburi-perl, libwww-perl, perl -Standards-Version: 3.9.4 +Standards-Version: 3.9.5 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libnet-facebook-oauth2-perl.git Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/libnet-facebook-oauth2-perl.git Homepage: https://metacpan.org/release/Net-Facebook-Oauth2 diff -Nru libnet-facebook-oauth2-perl-0.07/lib/Net/Facebook/Oauth2.pm libnet-facebook-oauth2-perl-0.08/lib/Net/Facebook/Oauth2.pm --- libnet-facebook-oauth2-perl-0.07/lib/Net/Facebook/Oauth2.pm 2013-08-21 20:31:24.000000000 +0000 +++ libnet-facebook-oauth2-perl-0.08/lib/Net/Facebook/Oauth2.pm 2013-10-10 13:25:04.000000000 +0000 @@ -11,7 +11,7 @@ use constant ACCESS_TOKEN_URL => 'https://graph.facebook.com/oauth/access_token'; use constant AUTHORIZE_URL => 'https://www.facebook.com/dialog/oauth'; -our $VERSION = '0.07'; +our $VERSION = '0.08'; sub new { my ($class,%options) = @_; @@ -33,7 +33,6 @@ } sub get_authorization_url { - my ($self,%params) = @_; $params{callback} ||= $self->{options}->{callback}; @@ -58,7 +57,6 @@ sub get_access_token { - my ($self,%params) = @_; $params{callback} ||= $self->{options}->{callback}; $params{code} ||= $self->{options}->{code}; @@ -105,8 +103,9 @@ my ($self,$url,$params) = @_; unless ($self->_has_access_token($url)) { croak "You must pass access_token" unless defined $self->{access_token}; - $url .= "?access_token=" . $self->{access_token}; - } + $url .= $self->{_has_query} ? '&' : '?'; + $url .= "access_token=" . $self->{access_token}; + } ##construct the new url my @array; @@ -167,6 +166,8 @@ my ($self, $url) = @_; my $uri = URI->new($url); my %q = $uri->query_form; + #also check if we have a query and save result + $self->{_has_query} = $uri->query(); if (grep { $_ eq 'access_token' } keys %q) { return 1; } diff -Nru libnet-facebook-oauth2-perl-0.07/t/accesstoken.t libnet-facebook-oauth2-perl-0.08/t/accesstoken.t --- libnet-facebook-oauth2-perl-0.07/t/accesstoken.t 2013-05-27 20:57:23.000000000 +0000 +++ libnet-facebook-oauth2-perl-0.08/t/accesstoken.t 2013-10-10 13:29:33.000000000 +0000 @@ -15,7 +15,18 @@ is $access_token, 'AccessToken', $message; } elsif ($message =~ m/with access token/) { is $access_token, 'OtherToken', $message; + } elsif ($message =~ m/with already set query/) { + my $query = $env->{QUERY_STRING}; + ok($query !~ /limit=1000\?/); + ok($query =~ /^limit=1000&access_token/); + } elsif ($message =~ m/without already set query/) { + my $query = $env->{QUERY_STRING}; + ok($query =~ /^access_token/); + } elsif ($message =~ m/Get request with token and query/) { + my $query = $env->{QUERY_STRING}; + ok($query =~ /^limit=1000&access_token=OtherToken&message/); } + return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'OK' ] ]; }; @@ -33,6 +44,12 @@ $fb->post("$url?access_token=OtherToken", { message => 'Post request with access token' }); $fb->get($url, { message => 'Get request without access token' }); $fb->get("$url?access_token=OtherToken", { message => 'Get request with access token' }); + + ##new bug tests -- adding query to another query ?limit=100?access_token + $fb->get("$url?limit=1000", { message => 'Get request with already set query' }); + $fb->get("$url", { message => 'Get request without already set query' }); + $fb->get("$url?limit=1000&access_token=OtherToken", { message => 'Get request with token and query' }); + }, server => sub { my $port = shift; @@ -44,6 +61,6 @@ }, ); -done_testing; +done_testing(8); __END__