diff options
author | Artur Signell <artur@vaadin.com> | 2015-04-28 23:50:19 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-05-05 12:54:18 +0000 |
commit | 79c8c696c09b0a7cbe1f1863e6c7c165b2f5f19f (patch) | |
tree | bb134a9ecc600448cbd54e5629e37e5c8978d22e | |
parent | a4544124c5f8fa70a70dfdf7dd4f511f53094069 (diff) | |
download | vaadin-framework-79c8c696c09b0a7cbe1f1863e6c7c165b2f5f19f.tar.gz vaadin-framework-79c8c696c09b0a7cbe1f1863e6c7c165b2f5f19f.zip |
Ensure browser does not re-use push connection after refresh (#14297, #14416)
Change-Id: I99748db0f00a6b2189f557fa05a145906a841efc
-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 552f2e9e03..35bc3f2e55 100644 --- a/server/src/com/vaadin/server/communication/PushHandler.java +++ b/server/src/com/vaadin/server/communication/PushHandler.java @@ -79,12 +79,18 @@ public class PushHandler { 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"); } |