From c30ccd6bb37ff870d4b47e940be00aeb902bf421 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Fri, 17 Apr 2009 15:27:20 +0000 Subject: [PATCH] set the file name to assist manual download git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@17236 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/Slave.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index 406c67f691..e25c337319 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -345,6 +345,9 @@ public abstract class Slave extends Node implements Serializable { public void doIndex( StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { URLConnection con = connect(); + // since we end up redirecting users to jnlpJars/foo.jar/, set the content disposition + // so that browsers can download them in the right file name. + rsp.setHeader("Content-Disposition", "inline; filename=" + fileName); InputStream in = con.getInputStream(); rsp.serveFile(req, in, con.getLastModified(), con.getContentLength(), "*.jar" ); in.close();