The HttpHeader's ContentLength is a byte unit
This commit is contained in:
+3
-3
@@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
@@ -195,7 +196,7 @@ public class DefaultLoginPageGeneratingFilter extends GenericFilterBean {
|
||||
String loginPageHtml = generateLoginPageHtml(request, loginError,
|
||||
logoutSuccess);
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setContentLength(loginPageHtml.length());
|
||||
response.setContentLength(loginPageHtml.getBytes(StandardCharsets.UTF_8).length);
|
||||
response.getWriter().write(loginPageHtml);
|
||||
|
||||
return;
|
||||
@@ -299,8 +300,7 @@ public class DefaultLoginPageGeneratingFilter extends GenericFilterBean {
|
||||
|
||||
private void renderHiddenInputs(StringBuilder sb, HttpServletRequest request) {
|
||||
for(Map.Entry<String, String> input : this.resolveHiddenInputs.apply(request).entrySet()) {
|
||||
sb.append(" <input name=\"" + input.getKey()
|
||||
+ "\" type=\"hidden\" value=\"" + input.getValue() + "\" />\n");
|
||||
sb.append(" <input name=\"").append(input.getKey()).append("\" type=\"hidden\" value=\"").append(input.getValue()).append("\" />\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user