Merge pull request #4734 from eclipse/jetty-9.4.x-4529-servlet-in-errorpage

Issue #4529 - Fixing HTML error page from showing servlet info if configured not to do so
This commit is contained in:
Joakim Erdfelt 2020-04-02 07:03:37 -05:00 committed by GitHub
commit b070c08ad7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -416,7 +416,10 @@ public class ErrorHandler extends AbstractHandler
htmlRow(writer, "URI", uri);
htmlRow(writer, "STATUS", status);
htmlRow(writer, "MESSAGE", message);
htmlRow(writer, "SERVLET", request.getAttribute(Dispatcher.ERROR_SERVLET_NAME));
if (isShowServlet())
{
htmlRow(writer, "SERVLET", request.getAttribute(Dispatcher.ERROR_SERVLET_NAME));
}
Throwable cause = (Throwable)request.getAttribute(Dispatcher.ERROR_EXCEPTION);
while (cause != null)
{
@ -457,7 +460,7 @@ public class ErrorHandler extends AbstractHandler
while (cause != null)
{
writer.printf("CAUSED BY %s%n", cause);
if (_showStacks && !_disableStacks)
if (isShowStacks() && !_disableStacks)
{
cause.printStackTrace(writer);
}