提交 20bd4e30 编写于 作者: D Daniel Beck

[FIX JENKINS-14899] Don't use truncating LargeText for /consoleText

上级 b6bff4f2
......@@ -39,10 +39,7 @@ import hudson.Functions;
import hudson.Util;
import hudson.XmlFile;
import hudson.cli.declarative.CLIMethod;
import hudson.console.AnnotatedLargeText;
import hudson.console.ConsoleLogFilter;
import hudson.console.ConsoleNote;
import hudson.console.ModelHyperlinkNote;
import hudson.console.*;
import hudson.model.Descriptor.FormException;
import hudson.model.Run.RunExecution;
import hudson.model.listeners.RunListener;
......@@ -2089,19 +2086,13 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
*/
public void doConsoleText(StaplerRequest req, StaplerResponse rsp) throws IOException {
rsp.setContentType("text/plain;charset=UTF-8");
// Prevent jelly from flushing stream so Content-Length header can be added afterwards
FlushProofOutputStream out = new FlushProofOutputStream(rsp.getCompressedOutputStream(req));
try{
getLogText().writeLogTo(0,out);
} catch (IOException e) {
// see comment in writeLogTo() method
InputStream input = getLogInputStream();
try {
IOUtils.copy(input, out);
} finally {
IOUtils.closeQuietly(input);
}
} finally {
PlainTextConsoleOutputStream out = new PlainTextConsoleOutputStream(rsp.getCompressedOutputStream(req));
InputStream input = getLogInputStream();
try {
IOUtils.copy(input, out);
out.flush();
} finally {
IOUtils.closeQuietly(input);
IOUtils.closeQuietly(out);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册