Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Ensure that when the Default or WebDAV servlets process an error disp…
Browse files Browse the repository at this point in the history
…atch that the error resource is processed via the doGet() method irrespective of the method used for the original request that triggered the error.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc8.0.x/trunk@1793489 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed May 2, 2017
1 parent e070a31 commit 25d3c0d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions java/org/apache/catalina/servlets/DefaultServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,18 @@ protected String getPathPrefix(final HttpServletRequest request) {
}


@Override
protected void service(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {

if (req.getDispatcherType() == DispatcherType.ERROR) {
doGet(req, resp);
} else {
super.service(req, resp);
}
}


/**
* Process a GET request for the specified resource.
*
Expand Down
6 changes: 6 additions & 0 deletions java/org/apache/catalina/servlets/WebdavServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.TimeZone;
import java.util.Vector;

import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
Expand Down Expand Up @@ -312,6 +313,11 @@ protected void service(HttpServletRequest req, HttpServletResponse resp)
return;
}

if (req.getDispatcherType() == DispatcherType.ERROR) {
doGet(req, resp);
return;
}

final String method = req.getMethod();

if (debug > 0) {
Expand Down
6 changes: 6 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
determining if the current request is for custom error page or not.
(markt)
</fix>
<fix>
Ensure that when the Default or WebDAV servlets process an error
dispatch that the error resource is processed via the
<code>doGet()</code> method irrespective of the method used for the
original request that triggered the error. (markt)
</fix>
</changelog>
</subsection>
<subsection name="Jasper">
Expand Down

0 comments on commit 25d3c0d

Please sign in to comment.