如何修复 net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 java web 应用程序?
我正在开发一个 java web 应用程序,并且正在 InitSession 类的 doFilter() 方法中设置 jsessionid 属性:HttpOnly、Secure 和 SameSite。我这样设置:
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filterChain) throws IOException, ServletException {
Cookie jsessionCookie = RequestHelper.getCookie(request, SESSION_COOKIE_NAME);
SecurityWrapperResponse
securityWrapperResponse = new SecurityWrapperResponse(response, "sanitize");
String contextPath = request.getServletContext() != null && StringUtils.isNotBlank(request.getServletContext().getContextPath()) ? request.getServletContext().getContextPath() : ROOT_CONTEXT;
ESAPI.httpUtilities().setHeader("Set-Cookie", jsessionCookie.getName() + "=" + jsessionCookie.getValue() + SESSION_PATH_ATTRIBUTE + contextPath + SAME_SITE_ATTRIBUTE_VALUES);
filterChain.doFilter(request, response);
.
.
.
}
当导航到应用程序中的第三页时,我收到错误: 净::ERR_INCOMPLETE_CHUNKED_ENCODING 200 这只是在我使用上面的代码 setHeader 之后才开始发生。任何想法将不胜感激!
谢谢
I am working on a java web app and I am setting the jsessionid attributes: HttpOnly, Secure and SameSite in the doFilter() method of InitSession class. I have this set as such:
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filterChain) throws IOException, ServletException {
Cookie jsessionCookie = RequestHelper.getCookie(request, SESSION_COOKIE_NAME);
SecurityWrapperResponse
securityWrapperResponse = new SecurityWrapperResponse(response, "sanitize");
String contextPath = request.getServletContext() != null && StringUtils.isNotBlank(request.getServletContext().getContextPath()) ? request.getServletContext().getContextPath() : ROOT_CONTEXT;
ESAPI.httpUtilities().setHeader("Set-Cookie", jsessionCookie.getName() + "=" + jsessionCookie.getValue() + SESSION_PATH_ATTRIBUTE + contextPath + SAME_SITE_ATTRIBUTE_VALUES);
filterChain.doFilter(request, response);
.
.
.
}
When navigating to the 3rd page in the app I get the error:
net::ERR_INCOMPLETE_CHUNKED_ENCODING 200
This only started happening after I setHeader with the code above. Any ideas would be much appreciated!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过更新需要此更新的旧库解决了此问题: https: //mvnrepository.com/artifact/org.directwebremoting/dwr/3.0.2-RELEASE
This issue was resolved by updating an old library that needed this update: https://mvnrepository.com/artifact/org.directwebremoting/dwr/3.0.2-RELEASE