提交 e128871e 编写于 作者: K kohsuke

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
上级 1c6c8ba9
......@@ -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");
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册