]> source.dussan.org Git - vaadin-framework.git/commitdiff
Set heartbeat response Content-Type to text/plain (#12182)
authorJohannes Dahlström <johannesd@vaadin.com>
Tue, 9 Jul 2013 09:03:30 +0000 (12:03 +0300)
committerJohannes Dahlström <johannesd@vaadin.com>
Tue, 9 Jul 2013 09:03:30 +0000 (12:03 +0300)
By default browsers assume text/html and may complain about an empty response body.

Change-Id: I66ed1aef3421a7f0a618bc441ffab1dc0efbdc71

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

index 16c21224ab730126ebf75feb46f88d60b0f016a0..4c9585920341f0bb5bd8237e217da34113ff0146 100644 (file)
@@ -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");
         }