diff options
author | Artur Signell <artur@vaadin.com> | 2015-04-28 23:50:19 +0300 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2015-05-15 08:48:47 +0300 |
commit | 61c3f455df27e7360db78517bfa5989c260d070b (patch) | |
tree | 40cafbc017019ea54be9bc175d9da9d372e2fc89 | |
parent | aca7f85b9793b3042b877d627c02e2613fb3e713 (diff) | |
download | vaadin-framework-61c3f455df27e7360db78517bfa5989c260d070b.tar.gz vaadin-framework-61c3f455df27e7360db78517bfa5989c260d070b.zip |
Ensure browser does not re-use push connection after refresh (#14297,
#14416)
Change-Id: I05804eea5a514e84cf27214ed0dd715242cbde90
-rw-r--r-- | server/src/com/vaadin/server/communication/PushHandler.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/server/src/com/vaadin/server/communication/PushHandler.java b/server/src/com/vaadin/server/communication/PushHandler.java index ea937d279e..f14aa4826c 100644 --- a/server/src/com/vaadin/server/communication/PushHandler.java +++ b/server/src/com/vaadin/server/communication/PushHandler.java @@ -108,12 +108,18 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter { resource.getResponse().setContentType("text/plain; charset=UTF-8"); VaadinSession session = ui.getSession(); - if (resource.transport() == TRANSPORT.STREAMING) { - // Must ensure that the streaming response contains + if (resource.transport() == TRANSPORT.STREAMING + || resource.transport() == TRANSPORT.LONG_POLLING) { + // Must ensure that the streaming/long-polling response contains // "Connection: close", otherwise iOS 6 will wait for the // response to this request before sending another request to // the same server (as it will apparently try to reuse the same - // connection) + // connection). + + // Other browsers might also try to re-use the same + // connection for fetching static files after refreshing, which + // will cause a failure in loading vaadinPush.js or + // vaadinBootstrap.js resource.getResponse().addHeader("Connection", "close"); } |