summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2011-07-22 16:19:02 +0200
committerfranck cuny <franck@lumberjaph.net>2011-07-26 13:21:02 +0200
commit4463e46406ac8aeef4cc5317c8befe852a1a84b6 (patch)
tree760c17ccddf03c21d517c800b94f28660a701b25
parenttests for oauth (diff)
downloadnet-http-spore-4463e46406ac8aeef4cc5317c8befe852a1a84b6.tar.gz
fix test for port and schene
Signed-off-by: franck cuny <franck@lumberjaph.net>
-rw-r--r--lib/Net/HTTP/Spore/Middleware/Auth/OAuth.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Net/HTTP/Spore/Middleware/Auth/OAuth.pm b/lib/Net/HTTP/Spore/Middleware/Auth/OAuth.pm
index ffff80b..9ec49a4 100644
--- a/lib/Net/HTTP/Spore/Middleware/Auth/OAuth.pm
+++ b/lib/Net/HTTP/Spore/Middleware/Auth/OAuth.pm
@@ -92,13 +92,18 @@ sub _base_string {
     my $scheme = $req->scheme;
     my $port   = $req->port;
 
-    if ($port == 80 and $scheme eq 'http'){
+    if ( $port == 80 && $scheme eq 'http' ) {
         $port = undef;
     }
-    if (defined $scheme && $port == 443 and $scheme eq 'https'){
+    if (   defined $port
+        && defined $scheme
+        && $port == 443
+        && $scheme eq 'https' )
+    {
         $port = undef;
     }
 
+
     my $uri =
         ( $scheme || 'https' ) . "://"
       . $req->env->{SERVER_NAME}