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
This commit is contained in:
kohsuke committed 2007-07-29 17:53:56 +00:00
1 parent 1c6c8ba9c5
commit e128871e8b
1 file changed
+3 -1
+3 -1
View File
@@ -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");
}
}