Apache-WebDAV
view release on metacpan or search on metacpan
lib/Apache/WebDAV.pm view on Meta::CPAN
}
# If the requested path is a directory, it's unclear what we're supposed to
# do. Net::DAV::Server prints an HTML representation of the directory
# structure.
#
# Update: this happens if you connect with a regular browser, or if you
# connect using IE but don't check the Web Folder box. So just print a
# warning.
elsif($handler->test('d', $path))
{
$r->content_type('text/html; charset="utf-8"');
$r->send_http_header();
$r->print("If you are using IE, please use File -> Open and check the
Open As Web Folder box.");
}
else
{
return NOT_FOUND;
}
}
lib/Apache/WebDAV.pm view on Meta::CPAN
my ($self, $r, $handler) = @_;
my $path = $r->uri();
if($handler->test('f', $path))
{
$r->header_out('Last-Modified', $handler->modtime($path));
}
elsif($handler->test('d', $path))
{
$r->content_type('text/html; charset="utf-8"');
$r->send_http_header();
}
else
{
return NOT_FOUND;
}
return OK;
}
lib/Apache/WebDAV.pm view on Meta::CPAN
my $depth = $r->header_in('Depth');
my $uri = $r->uri();
# Make sure the resource exists
if(!$handler->test('e', $uri))
{
return NOT_FOUND;
}
$r->status(207);
$r->content_type('text/xml; charset="utf-8"');
my @files;
if($depth == 0)
{
@files = ($uri);
}
elsif($depth == 1)
{
$uri =~ s/\/$//; # strip trailing slash, we don't store it in the db
lib/Apache/WebDAV.pm view on Meta::CPAN
{
my $response = $doc->createElement('D:response');
$response->appendTextChild('D:href' => $file);
$response->appendTextChild('D:status' => 'HTTP/1.1 403 Forbidden');
$multistat->addChild($response);
}
$r->status(207);
$r->content_type('text/xml; charset="utf-8"');
$r->send_http_header();
if(!$r->header_only())
{
$r->print($doc->toString(1));
}
return OK;
}
( run in 0.237 second using v1.01-cache-2.11-cpan-4d50c553e7e )