From 33647404e97b80bc12c7fde76d23ea4abe97bf4f Mon Sep 17 00:00:00 2001 From: KatriHaapalinna Date: Tue, 13 Feb 2018 15:42:06 +0200 Subject: [PATCH] Add Content-Type with charset to notifications sent via Push Fixes #9922 --- .../main/java/com/vaadin/server/communication/PushHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/main/java/com/vaadin/server/communication/PushHandler.java b/server/src/main/java/com/vaadin/server/communication/PushHandler.java index 08e0d798bc..6591596a47 100644 --- a/server/src/main/java/com/vaadin/server/communication/PushHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PushHandler.java @@ -41,6 +41,7 @@ import com.vaadin.server.VaadinServletRequest; import com.vaadin.server.VaadinServletService; import com.vaadin.server.VaadinSession; import com.vaadin.shared.ApplicationConstants; +import com.vaadin.shared.JsonConstants; import com.vaadin.shared.communication.PushMode; import com.vaadin.ui.UI; @@ -467,6 +468,7 @@ public class PushHandler { "sendNotificationAndDisconnect called for resource no longer in scope"); return; } + resource.getResponse().setContentType(JsonConstants.JSON_CONTENT_TYPE); resource.getResponse().getWriter().write(notificationJson); resource.resume(); } catch (Exception e) { -- 2.39.5