mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 14:02:22 +00:00
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
This commit is contained in:
1 parent
db463e4c92
commit
c30ccd6bb3
1 file changed
+3
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user