Skip to content
Snippets Groups Projects
Commit d99a8bea authored by Vincent Massol's avatar Vincent Massol
Browse files

XWIKI-21793: Read-Only stack trace in the logs with Jetty 12

parent d8c16692
No related branches found
No related tags found
No related merge requests found
......@@ -663,13 +663,17 @@ protected static Cookie addCookie(XWikiContext context)
cookie.setDomain(cookieDomain);
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Setting cookie " + cookie.getValue() + " for name " + cookie.getName() + " with domain "
+ cookie.getDomain() + " and path " + cookie.getPath() + " and maxage " + cookie.getMaxAge());
// TODO: Fix the code below. It's called after the response has been flushed in XWikiAction and thus the
// cookie is not added. To prevent any stack trace in the logs, we have added the IF on the response.
// However, this whole logic needs to be reviewed since right now it means this cookie is never set.
if (!context.getResponse().isCommitted()) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Setting cookie " + cookie.getValue() + " for name " + cookie.getName() + " with domain "
+ cookie.getDomain() + " and path " + cookie.getPath() + " and maxage " + cookie.getMaxAge());
}
context.getResponse().addCookie(cookie);
}
context.getResponse().addCookie(cookie);
return cookie;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment