diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index e1dd185e4e..42e4b8f551 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -383,7 +383,9 @@ public class Functions { public static void adminCheck(StaplerRequest req, StaplerResponse rsp, Object required) throws IOException, ServletException { if(required!=null && !Hudson.adminCheck(req,rsp)) { - // check failed + // check failed. commit the FORBIDDEN response, then abort. + rsp.setStatus(HttpServletResponse.SC_FORBIDDEN); + rsp.getOutputStream().close(); throw new ServletException("Unauthorized access"); } }