From 5e26b0b6d9c97210d97e3e81f1af33feaa4751eb Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 30 May 2013 16:04:33 +0300 Subject: [PATCH] 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 --- .../src/com/vaadin/server/communication/PushHandler.java | 7 +++++++ 1 file changed, 7 insertions(+) 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( -- 2.39.5