Permalink
Browse files

[FIXED JENKINS-13625]

In the end, proper fix requires having a filter that tracks
GZipOutputStream.
(cherry picked from commit 18963ee)

Conflicts:

	core/src/main/java/hudson/security/HudsonAuthenticationEntryPoint.java
  • Loading branch information...
kohsuke authored and vjuranek committed May 24, 2012
1 parent 6b495ce commit 47bb6d8ab64700cb821b44691d704b145281c253
@@ -42,7 +42,7 @@ THE SOFTWARE.

<properties>
<staplerFork>true</staplerFork>
<stapler.version>1.188</stapler.version>
<stapler.version>1.189</stapler.version>
</properties>

<dependencies>
@@ -78,8 +78,7 @@ public void commence(ServletRequest request, ServletResponse response, Authentic
rsp.setContentType("text/html;charset=UTF-8");
PrintWriter out;
try {
ServletOutputStream sout = rsp.getOutputStream();
out = new PrintWriter(new OutputStreamWriter(sout));
out = new PrintWriter(new OutputStreamWriter(rsp.getOutputStream()));
} catch (IllegalStateException e) {
out = rsp.getWriter();
}
@@ -95,7 +94,7 @@ public void commence(ServletRequest request, ServletResponse response, Authentic
// See http://support.microsoft.com/kb/294807
for (int i=0; i < 10; i++)
out.print(" ");
out.flush();
out.close();
}
}
}
@@ -2972,6 +2972,13 @@ public void doGc(StaplerResponse rsp) throws IOException {
rsp.getWriter().println("GCed");
}

/**
* End point that intentionally throws an exception to test the error behaviour.
*/
public void doException() {
throw new RuntimeException();
}

public ContextMenu doContextMenu(StaplerRequest request, StaplerResponse response) throws IOException, JellyException {
return new ContextMenu().from(this,request,response);
}
@@ -48,6 +48,10 @@ THE SOFTWARE.
<filter-name>encoding-filter</filter-name>
<filter-class>hudson.util.CharacterEncodingFilter</filter-class>
</filter>
<filter>
<filter-name>compression-filter</filter-name>
<filter-class>org.kohsuke.stapler.compression.CompressionFilter</filter-class>
</filter>
<filter>
<filter-name>authentication-filter</filter-name>
<filter-class>hudson.security.HudsonFilter</filter-class>
@@ -110,6 +114,10 @@ THE SOFTWARE.
<filter-name>encoding-filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>compression-filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>authentication-filter</filter-name>
<url-pattern>/*</url-pattern>

0 comments on commit 47bb6d8

Please sign in to comment.