From: Artur Signell Date: Thu, 30 May 2013 13:04:33 +0000 (+0300) Subject: Fix streaming issue with iOS6 (#11934) X-Git-Tag: 7.1.0~90^2~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5e26b0b6d9c97210d97e3e81f1af33feaa4751eb;p=vaadin-framework.git Fix streaming issue with iOS6 (#11934) 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 --- diff --git a/server/src/com/vaadin/server/communication/PushHandler.java b/server/src/com/vaadin/server/communication/PushHandler.java index 37adc1a108..a44df79221 100644 --- a/server/src/com/vaadin/server/communication/PushHandler.java +++ b/server/src/com/vaadin/server/communication/PushHandler.java @@ -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(