tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48098] New: Cyrillyc(or any escaped with %) symbols inaccessible via WebDav servlet (fix proposed)
Date Sun, 01 Nov 2009 22:08:20 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48098

           Summary: Cyrillyc(or any escaped with %) symbols inaccessible
                    via WebDav servlet (fix proposed)
           Product: Tomcat 6
           Version: 6.0.20
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: nikolaz@ukr.net


When I create, read, update, delete any file|folder with symbols that are
escaped (' or any Cyrillic char ) - I got an error.

I've fixed it for me, patching WebdavServlet.java method getRelativePath(). On
each return I unescape symbols:

protected String getRelativePath(HttpServletRequest request) {
        // Are we being processed by a RequestDispatcher.include()?
        if (request.getAttribute(Globals.INCLUDE_REQUEST_URI_ATTR) != null) {
            String result = (String) request
                    .getAttribute(Globals.INCLUDE_PATH_INFO_ATTR);
            if ((result == null) || (result.equals("")))
                result = "/";
            return unescape(result);
        }

        // No, extract the desired path directly from the request
        String result = request.getPathInfo();
        if ((result == null) || (result.equals(""))) {
            result = "/";
        }
        return unescape(result);
    }

This unescape() method is from official W3C site:
http://www.w3.org/International/unescape.java

Now it works excellent for me.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message