mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-04 23:55:52 +00:00
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:
1 parent
1c6c8ba9c5
commit
e128871e8b
1 file changed
+3
-1
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user