front-end CLI hook up. This feature is now visible

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@17623 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-04-29 16:57:38 +00:00
1 parent e0ec3e0711
commit 15e4a360eb
5 files changed
+55 -2

No files matched your search

+5 -1
View File
@@ -2714,7 +2714,11 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
*/
public void doCli(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException {
checkPermission(READ);
requirePOST();
if(!"POST".equals(Stapler.getCurrentRequest().getMethod())) {
// for GET request, serve _cli.jelly, assuming this is a browser
req.getView(this,"_cli.jelly").forward(req,rsp);
return;
}
UUID uuid = UUID.fromString(req.getHeader("Session"));
rsp.setHeader("Hudson-Duplex",""); // set the header so that the client would know