Skip to content
Permalink
Browse files

Merge pull request #1733 from daniel-beck/JENKINS-14899

[FIX JENKINS-14899] Don't use truncating LargeText for /consoleText
  • Loading branch information
daniel-beck committed Jun 11, 2015
2 parents 9b7d8e9 + 20bd4e3 commit ad7cba99d7eef6e2849baeed427a452b8ba874bd
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 ad7cba9

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