]> source.dussan.org Git - vaadin-framework.git/commitdiff
Ensure browser does not re-use push connection after refresh (#14297,
authorArtur Signell <artur@vaadin.com>
Tue, 28 Apr 2015 20:50:19 +0000 (23:50 +0300)
committerHenri Sara <hesara@vaadin.com>
Fri, 15 May 2015 05:48:47 +0000 (08:48 +0300)
#14416)

Change-Id: I05804eea5a514e84cf27214ed0dd715242cbde90

server/src/com/vaadin/server/communication/PushHandler.java

index ea937d279e29657a70e7f7a9c9e1f18b8bf5f9f5..f14aa4826cb86ff33404a45d3064cd722ff31918 100644 (file)
@@ -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");
             }