Bug 28591 - Command MOVE don't work
Summary: Command MOVE don't work
Status: RESOLVED DUPLICATE of bug 26906
Alias: None
Product: Tomcat 4
Classification: Unclassified
Component: Servlets:WebDAV (show other bugs)
Version: 4.1.30
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-26 08:31 UTC by Joan Codina
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joan Codina 2004-04-26 08:31:48 UTC
Rename files don't work. 

I've found that in the method copyResource (called by doMove) when calls 
the "normalize" method it adds a "/" at the beginning of destinationPath.


    /**
     * Copy a resource.
     *
     * @param req Servlet request
     * @param resp Servlet response
     * @return boolean true if the copy is successful
     */
    private boolean copyResource(HttpServletRequest req,
                                 HttpServletResponse resp)
        throws ServletException, IOException {

        // Parsing destination header

        String destinationPath = req.getHeader("Destination");

        if (destinationPath == null) {
            resp.sendError(WebdavStatus.SC_BAD_REQUEST);
            return false;
        }
// Before normalize --> destinationPath is http://localhost:8080/webdav/...
        destinationPath = 
            normalize(RequestUtil.URLDecode(destinationPath, "UTF8"));
// After normalize --> destinationPath is /localhost:8080/webdav/...
        int protocolIndex = destinationPath.indexOf("://");
Comment 1 Mark Thomas 2004-04-26 22:39:44 UTC
This is fixed in CVS.

*** This bug has been marked as a duplicate of 26906 ***