Skip to content
Permalink
Browse files

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

  • Loading branch information
daniel-beck committed Jun 9, 2015
1 parent b6bff4f commit 20bd4e304976dc64fa6abc165823425ba524ccb2
Showing with 8 additions and 17 deletions.
  1. +8 −17 core/src/main/java/hudson/model/Run.java
@@ -39,10 +39,7 @@
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 void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryPar
*/
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);
}
}

0 comments on commit 20bd4e3

Please sign in to comment.
You can’t perform that action at this time.