Skip Menu |

This queue is for tickets about the HTTP-DAV CPAN distribution.

Report information
The Basics
Id: 60880
Status: open
Worked: 30 min
Priority: 0/
Queue: HTTP-DAV

People
Owner: OPERA [...] cpan.org
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.41
Fixed in: (no value)



Subject: Unable to open DAV resources on the hosts root
Try this script, it fails: #!/usr/bin/perl -w use HTTP::DAV; my $url = "http://demo.sabredav.org/"; my $d = new HTTP::DAV; $d->credentials( -user=>"testuser", -pass =>"test", -url=>$url, -realm=>"SabreDAV" ); $d->open( -url=>$url ) or die("Couldn't open $url: " .$d->message . "\n"); while this succeeds: #!/usr/bin/perl -w use HTTP::DAV; my $url = "http://demo.bingodisk.com/bingo/"; my $d = new HTTP::DAV; $d->credentials( -user=>"demo\@bingodisk.com", -pass =>"bingo", -url=>$url, -realm=>"demo.bingodisk.com" ); $d->open( -url=>$url ) or die("Couldn't open $url: " .$d->message . "\n"); As it seems, HTTP::DAV is unable to open DAV resources located on a server's root. Error returned is: "Couldn't open http://demo.sabredav.org/: Operation failed. You can only open a collection (directory)" Both servers are public WebDAV demo servers. And my tests with different DAV clients (gvfs, neon) did show that they both return equally valid responses.
RT-Send-CC: pcollins [...] cpan.org
On Mon Aug 30 13:39:40 2010, isync wrote: Show quoted text
> Try this script, it fails: > > #!/usr/bin/perl -w > use HTTP::DAV; > my $url = "http://demo.sabredav.org/"; > my $d = new HTTP::DAV; > $d->credentials( -user=>"testuser", -pass =>"test", -url=>$url, > -realm=>"SabreDAV" ); > $d->open( -url=>$url ) or die("Couldn't open $url: " .$d->message .
"\n"); Show quoted text
> > while this succeeds: > > #!/usr/bin/perl -w > use HTTP::DAV; > my $url = "http://demo.bingodisk.com/bingo/"; > my $d = new HTTP::DAV; > $d->credentials( -user=>"demo\@bingodisk.com", -pass =>"bingo", > -url=>$url, -realm=>"demo.bingodisk.com" ); > $d->open( -url=>$url ) or die("Couldn't open $url: " .$d->message .
"\n"); Show quoted text
> > As it seems, HTTP::DAV is unable to open DAV resources located on a > server's root. Error returned is: "Couldn't open > http://demo.sabredav.org/: Operation failed. You can only open a > collection (directory)" > > Both servers are public WebDAV demo servers. And my tests with
different Show quoted text
> DAV clients (gvfs, neon) did show that they both return equally valid > responses.
I tried your first script, and I can reproduce the error. However, trying to open the root folder '/' of one of our test servers works just fine. I see several differences. One of them is that sabredav.org is using nginx instead of Apache's mod_dav. Here's the dump of the response I get from sabredav.org: --------------------------------------------------------------------- url is 'http://demo.sabredav.org/' url transformed into 'http://demo.sabredav.org/' by make_trail_slash $resp->as_string=Multistatus lines: Error number 0 (http://demo.sabredav.org/): Href: http://demo.sabredav.org/ Mesg(code): Unprocessable Entity, no XML body. (422) Desc: HTTP/1.1 207 Multistatus Cache-Control: max-age=172800 Connection: close Date: Tue, 07 Sep 2010 09:49:09 GMT Server: nginx/0.7.63 Content-Length: 522 Content-Type: application/xml; charset=utf-8 Expires: Thu, 09 Sep 2010 09:49:09 GMT Client-Date: Tue, 07 Sep 2010 09:49:37 GMT Client-Peer: 216.34.181.97:80 Client-Response-Num: 1 X-Powered-By: PHP/5.2.11 <?xml version="1.0" encoding="utf-8"?> <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http:// calendarserver.org/ns/"><d:response><d:href>/</ d:href><d:propstat><d:prop><d:getlastmodified xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" b:dt="dateTime.rfc1123">Tue, 07 Sep 2010 09:49:09 +0000</ d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></ d:prop><d:status>HTTP/1.1 200 Ok</d:status></d:propstat></d:response></ d:multistatus> $res->as_string =Resource 'Url': http://demo.sabredav.org/ Properties '_locks': Couldn't open http://demo.sabredav.org/: Operation failed. You can only open a collection (directory) ----------------------------------------------------------------------- Which is different from a normal response I get (200 OK) when I query one of our test servers. It might be that HTTP::DAV doesn't understand a that type of multistatus response?