提交 5bba8c76 编写于 作者: K Kohsuke Kawaguchi

use of "Content-Encoding:gzip" was causing the automatic login initiation to fail.

上级 95c1728c
......@@ -55,6 +55,9 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
When accessing a page that requires authentication, redirection to start authentication results in a content decoding failure.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-13625">issue 13625</a>)
<li class=bug>
Fixed a regression in untar operation in exotic platforms
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-13202">issue 13202</a>)
......
......@@ -34,10 +34,12 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.URLEncoder;
import java.text.MessageFormat;
import java.util.zip.GZIPOutputStream;
/**
* For anonymous requests to pages that require authentication,
......@@ -78,7 +80,13 @@ public class HudsonAuthenticationEntryPoint extends AuthenticationProcessingFilt
rsp.setContentType("text/html;charset=UTF-8");
PrintWriter out;
try {
ServletOutputStream sout = rsp.getOutputStream();
OutputStream sout = rsp.getOutputStream();
if (rsp.containsHeader("Content-Encoding")) {
// we serve Jelly pages with Content-Encoding:gzip.
// ServletResponse doesn't provide means for us to check the value of the header,
// so this is a hack.
sout = new GZIPOutputStream(sout);
}
out = new PrintWriter(new OutputStreamWriter(sout));
} catch (IllegalStateException e) {
out = rsp.getWriter();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册