From 76030dc1a021cc9fb83bdd65aa21b8f2580fc24b Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 29 Dec 2015 01:13:10 +0300 Subject: push: fix sendWNS --- src/main/java/com/juick/PushComponent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/juick/PushComponent.java b/src/main/java/com/juick/PushComponent.java index 84f91d9b..a813f1a2 100644 --- a/src/main/java/com/juick/PushComponent.java +++ b/src/main/java/com/juick/PushComponent.java @@ -263,6 +263,8 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe boolean ret = false; try { HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection(); + conn.setDoInput(true); + conn.setDoOutput(true); OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream()); conn.setRequestProperty("Content-Type", "text/xml; charset=utf-8"); @@ -273,8 +275,6 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe conn.setRequestProperty("X-WNS-Type", "wns/toast"); // todo: mb use "wns/badge" or "wns/tile" conn.setUseCaches(false); - conn.setDoInput(true); - conn.setDoOutput(true); conn.setRequestMethod("POST"); conn.connect(); -- cgit v1.2.3