未验证 提交 71c5fa5b 编写于 作者: T Tim Jacomb 提交者: GitHub

Merge pull request #4504 from daniel-beck/JENKINS-61121

[JENKINS-61121] Fix too many open files with resource domain
......@@ -346,13 +346,12 @@ public final class DirectoryBrowserSupport implements HttpResponse {
if(LOGGER.isLoggable(Level.FINE))
LOGGER.fine("Serving "+baseFile+" with lastModified=" + lastModified + ", length=" + length);
InputStream in = baseFile.open();
if (view) {
// for binary files, provide the file name for download
rsp.setHeader("Content-Disposition", "inline; filename=" + baseFile.getName());
// pseudo file name to let the Stapler set text/plain
rsp.serveFile(req, in, lastModified, -1, length, "plain.txt");
rsp.serveFile(req, baseFile.open(), lastModified, -1, length, "plain.txt");
} else {
if (resourceToken != null) {
// redirect to second domain
......@@ -368,7 +367,7 @@ public final class DirectoryBrowserSupport implements HttpResponse {
}
}
}
rsp.serveFile(req, in, lastModified, -1, length, baseFile.getName());
rsp.serveFile(req, baseFile.open(), lastModified, -1, length, baseFile.getName());
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册