]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix streaming issue with iOS6 (#11934)
authorArtur Signell <artur@vaadin.com>
Thu, 30 May 2013 13:04:33 +0000 (16:04 +0300)
committerArtur Signell <artur@vaadin.com>
Thu, 30 May 2013 13:29:16 +0000 (16:29 +0300)
It appears that iOS6 will not make new request (at least for images) to a server to which there is already a connection open which possibly will be kept alive after the current request is done (Connection: Keep-alive asked by the client and not denied by the server)

Change-Id: If4e6233457fced3760a931b7953fa1713fee3452

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

index 37adc1a108ea8c6040c93f72e02a14eaccd14bdc..a44df792211e9533a62b282edf11ac293dbc5b1a 100644 (file)
@@ -84,6 +84,13 @@ public class PushHandler implements AtmosphereHandler {
                 if (browser.isIE() && browser.getBrowserMajorVersion() == 8) {
                     resource.padding(LONG_PADDING);
                 }
+
+                // Must ensure that the streaming 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)
+                resource.getResponse().addHeader("Connection", "close");
             }
 
             String requestToken = resource.getRequest().getParameter(