diff options
author | edler-san <19165931+edler-san@users.noreply.github.com> | 2019-05-02 13:26:14 +0200 |
---|---|---|
committer | Sun Zhe <31067185+ZheSun88@users.noreply.github.com> | 2019-05-02 14:26:14 +0300 |
commit | 5fa144193c0d5ed2022e576431a20beead2bfeb8 (patch) | |
tree | ed3bfbf76b3794a0a10aa3a578417047cbe6bd6b /server/src/main | |
parent | b92df6d587eaa879f2ec31c1f5bba23d5698bae1 (diff) | |
download | vaadin-framework-5fa144193c0d5ed2022e576431a20beead2bfeb8.tar.gz vaadin-framework-5fa144193c0d5ed2022e576431a20beead2bfeb8.zip |
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.
Diffstat (limited to 'server/src/main')
-rw-r--r-- | server/src/main/java/com/vaadin/server/communication/HeartbeatHandler.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/src/main/java/com/vaadin/server/communication/HeartbeatHandler.java b/server/src/main/java/com/vaadin/server/communication/HeartbeatHandler.java index ed2faad05a..07ab402514 100644 --- a/server/src/main/java/com/vaadin/server/communication/HeartbeatHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/HeartbeatHandler.java @@ -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; } } |