Permalink
Browse files

Support couches that are password protected using http basic auth

  • Loading branch information...
1 parent 3dbf527 commit 6d74b3768396ca714f06a0bc0720a7a01d535a4a Luke Closs committed Sep 2, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/AnyEvent/CouchDB/Stream.pm
@@ -7,6 +7,7 @@ use AnyEvent::HTTP;
use Scalar::Util;
use JSON;
use Try::Tiny;
+use MIME::Base64;
our $VERSION = '0.01';
@@ -29,6 +30,10 @@ sub new {
$uri->path( $db. '/_changes' );
$uri->query_form( filter => $filter, feed => "continuous", since => $since );
+ if (my $userinfo = $uri->userinfo) {
+ $headers->{Authorization} = 'Basic ' . encode_base64($userinfo, '');
+ }
+
my $self = bless {}, $class;
{

0 comments on commit 6d74b37

Please sign in to comment.