Skip Menu |

This queue is for tickets about the AnyEvent-CouchDB CPAN distribution.

Report information
The Basics
Id: 55002
Status: resolved
Priority: 0/
Queue: AnyEvent-CouchDB

People
Owner: Nobody in particular
Requestors: michael [...] zedeler.dk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.13
Fixed in: (no value)



Subject: couchdb() defunct if using trailing backslash
If using my $couch = couchdb('http://some.host:7777/my_database'); subsequent calls fails because the uri attribute has been mangled. This is caused by the following code: sub couchdb { my $db = shift; if ($db =~ /^http:/) { my $uri = URI->new($db); my $name = basename($db); $uri .= '/' if ($uri !~ /\/$/); ^^^ HERE AnyEvent::CouchDB::Database->new($name, $uri); } else { AnyEvent::CouchDB->new->db($db); } } A patch has been included.
Subject: couch.patch
*** CouchDB.pm-old 2010-02-25 22:22:08.000000000 +0100 --- /usr/local/share/perl/5.10.0/AnyEvent/CouchDB.pm 2010-02-25 22:16:57.000000000 +0100 *************** *** 60,68 **** sub couchdb { my $db = shift; if ($db =~ /^http:/) { my $uri = URI->new($db); my $name = basename($db); - $uri .= '/' if ($uri !~ /\/$/); AnyEvent::CouchDB::Database->new($name, $uri); } else { AnyEvent::CouchDB->new->db($db); --- 60,68 ---- sub couchdb { my $db = shift; if ($db =~ /^http:/) { + $db .= '/' if ($db !~ /\/$/); my $uri = URI->new($db); my $name = basename($db); AnyEvent::CouchDB::Database->new($name, $uri); } else { AnyEvent::CouchDB->new->db($db);
Thanks for the patch. I've applied it, and I will have a new version of AnyEvent::CouchDB uploaded soon.
Subject: Re: [rt.cpan.org #55002] couchdb() defunct if using trailing backslash
Date: Thu, 25 Feb 2010 23:52:18 +0100
To: bug-AnyEvent-CouchDB [...] rt.cpan.org
From: Michael Zedeler <michael [...] zedeler.dk>
John Beppu via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=55002 > > > Thanks for the patch. > > I've applied it, and I will have a new version of AnyEvent::CouchDB > uploaded soon.
Great! Thanks! Michael.
applied the patch and uploaded a new version a few days ago. forgot to resolve ticket until now.