Browse Source

Changed the handleSessionExpired logic to return a 404 instead of a 410 and added the no-cache parameter to the reply. (#11556)

* Changed the handleSessionExpired logic to return a 404 instead of a 410. Also added the no-cache parameter to the reply.
See https://github.com/vaadin/framework/issues/4417 for discussion.
tags/8.9.0.alpha1
edler-san 5 years ago
parent
commit
5fa144193c

+ 8
- 1
server/src/main/java/com/vaadin/server/communication/HeartbeatHandler.java View File

@@ -89,7 +89,14 @@ public class HeartbeatHandler extends SynchronizedRequestHandler
return false;
}

response.sendError(HttpServletResponse.SC_GONE, "Session expired");
// Ensure that the browser does not cache expired response.
// iOS 6 Safari requires this (#10370)
response.setHeader("Cache-Control", "no-cache");
// If Content-Type is not set, browsers assume text/html and may
// complain about the empty response body (#12182)
response.setHeader("Content-Type", "text/plain");

response.sendError(HttpServletResponse.SC_NOT_FOUND, "Session expired");
return true;
}
}

Loading…
Cancel
Save