summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2011-05-29 13:56:43 +0200
committerfranck cuny <franck@lumberjaph.net>2011-07-26 13:20:00 +0200
commit7843de57f5d639b05b8024f1ec43dcb9ffb00463 (patch)
tree6792a41d37806d83f6f04ee0196c1f59a27c0a51
parentadd tests for middleware Auth::Header (diff)
downloadnet-http-spore-7843de57f5d639b05b8024f1ec43dcb9ffb00463.tar.gz
add spore.userinfo
Signed-off-by: franck cuny <franck@lumberjaph.net>
-rw-r--r--lib/Net/HTTP/Spore/Meta/Method.pm1
-rw-r--r--lib/Net/HTTP/Spore/Request.pm2
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/Net/HTTP/Spore/Meta/Method.pm b/lib/Net/HTTP/Spore/Meta/Method.pm
index 5c59dcf..2e55a89 100644
--- a/lib/Net/HTTP/Spore/Meta/Method.pm
+++ b/lib/Net/HTTP/Spore/Meta/Method.pm
@@ -210,6 +210,7 @@ sub wrap {
             'spore.payload'         => $payload,
             'spore.errors'          => *STDERR,
             'spore.url_scheme'      => $base_url->scheme,
+            'spore.userinfo'        => $base_url->userinfo,
             'spore.formats'         => $formats,
         };
 
diff --git a/lib/Net/HTTP/Spore/Request.pm b/lib/Net/HTTP/Spore/Request.pm
index a401dcc..d65e0e9 100644
--- a/lib/Net/HTTP/Spore/Request.pm
+++ b/lib/Net/HTTP/Spore/Request.pm
@@ -202,11 +202,13 @@ sub _uri_base {
 
     my $uri =
       ( $env->{'spore.url_scheme'} || "http" ) . "://"
+          .($env->{'spore.userinfo'} . '@'|| '')
       . (
         $env->{HTTP_HOST}
           || (( $env->{SERVER_NAME} || "" ) . ":"
             . ( $env->{SERVER_PORT} || 80 ) )
       ) . ( $env->{SCRIPT_NAME} || '/' );
+
     return $uri;
 }