From 6a4bbe52c399c58d43d7f81f322fe8b090df6921 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johannes=20Dahlstr=C3=B6m?= Date: Tue, 9 Jul 2013 12:03:30 +0300 Subject: [PATCH] Set heartbeat response Content-Type to text/plain (#12182) By default browsers assume text/html and may complain about an empty response body. Change-Id: I66ed1aef3421a7f0a618bc441ffab1dc0efbdc71 --- .../src/com/vaadin/server/communication/HeartbeatHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/src/com/vaadin/server/communication/HeartbeatHandler.java b/server/src/com/vaadin/server/communication/HeartbeatHandler.java index 16c21224ab..4c95859203 100644 --- a/server/src/com/vaadin/server/communication/HeartbeatHandler.java +++ b/server/src/com/vaadin/server/communication/HeartbeatHandler.java @@ -63,6 +63,9 @@ public class HeartbeatHandler extends SynchronizedRequestHandler implements // Ensure that the browser does not cache heartbeat responses. // iOS 6 Safari requires this (#10370) response.setHeader("Cache-Control", "no-cache"); + // If Content-Type is not set, browsers assume text/html and may + // complain about the empty response body (#12182) + response.setHeader("Content-Type", "text/plain"); } else { response.sendError(HttpServletResponse.SC_NOT_FOUND, "UI not found"); } -- 2.39.5