Author: markt Date: Tue May 2 14:47:59 2017 New Revision: 1793514 URL: http://svn.apache.org/viewvc?rev=1793514&view=rev Log: When the WebDAV servlet is configured and an error dispatch is made to a custom error page located below WEB-INF, ensure that the target error page is displayed rather than a 404 response.
Modified: tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java?rev=1793514&r1=1793513&r2=1793514&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java (original) +++ tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java Tue May 2 14:47:59 2017 @@ -306,6 +306,14 @@ public class WebdavServlet final String path = getRelativePath(req); + // Error page check needs to come before special path check since + // custom error pages are often located below WEB-INF so they are + // not directly accessible. + if (req.getDispatcherType() == DispatcherType.ERROR) { + doGet(req, resp); + return; + } + // Block access to special subdirectories. // DefaultServlet assumes it services resources from the root of the web app // and doesn't add any special path protection @@ -316,11 +324,6 @@ public class WebdavServlet return; } - if (req.getDispatcherType() == DispatcherType.ERROR) { - doGet(req, resp); - return; - } - final String method = req.getMethod(); if (debug > 0) { Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1793514&r1=1793513&r2=1793514&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Tue May 2 14:47:59 2017 @@ -99,6 +99,11 @@ be read, ensure that the intended error status is returned rather than a 404 or 403. (markt) </fix> + <fix> + When the WebDAV servlet is configured and an error dispatch is made to a + custom error page located below <code>WEB-INF</code>, ensure that the + target error page is displayed rather than a 404 response. (markt) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org