Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.2

Bug #12856 Directories cannot be accessed without trailing slash
Submitted: 2008-01-08 17:14 UTC
From: schmidt Assigned:
Status: Wont fix Package: HTTP_WebDAV_Client (version 1.0.0)
PHP Version: 5.2.0 OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 48 - 39 = ?

 
 [2008-01-08 17:14 UTC] schmidt (Christian Schmidt)
Description: ------------ For regular files, the trailing slash in directory names is optional. E.g. is_dir('/tmp') and is_dir('/tmp/') are equivalent. With HTTP_WebDAV_Client the trailing slash is required. E.g. if file_exists('webdav://exampel.com/foo/') returns true, then file_exists('webdav://exampel.com/foo') returns false. For consistency with the filesystem, I think HTTP_WebDAV_Client should support both variants. As a quick fix I have added the following the following to _check_options(): $req->sendRequest(); + if ($req->getResponseCode() == 301) { + $this->url .= '/'; + return $this->_check_options(); + } if ($req->getResponseCode() != 200) { return false; }

Comments

 [2008-04-24 03:23 UTC] hholzgra (Hartmut Holzgraefe)
Which server are you getting the 301 response from? I didn't expect a webdav server to issue redirect response headers ... but these might actually be valid and so need to be handled indeed (Note to self: check whether HTTP_WebDAV_Server should redirect on collection without trailing slash, too ...)
 [2008-05-19 08:07 UTC] kawai (Hiroaki Kawai)
In RFC2616 section 10.3, the spec says: "The action required MAY be carried out by the user agent without interaction with the user if and only if the method used in the second request is GET or HEAD." If you're using Apache httpd, consider using "redirect-carefully" environment variable: http://httpd.apache.org/docs/2.2/en/env.html#redirect-carefully
 [2008-05-19 08:11 UTC] kawai (Hiroaki Kawai)
I think HTTP_WebDAV_Client MAY handle redirections as what is done in http stream wrapper. http://www.php.net/manual/en/context.http.php#context.http.max-redirects
 [2009-08-25 12:06 UTC] cweiske (Christian Weiske)
-Status: Feedback +Status: Open
 [2014-04-18 09:57 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Wont fix
Marking as a wontfix for the moment, because it hasn't moved in ~6 years. Patches/pull requests welcome.