From e128871e8baba8185fec60fa93d82d770e97786c Mon Sep 17 00:00:00 2001 From: kohsuke Date: Sun, 29 Jul 2007 17:53:56 +0000 Subject: [PATCH] improved the error handling. Send back 403 if the access is forbidden. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3910 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/Functions.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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"); } }