Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Merge branch 'AGPUSH-1074-simplepush-fix-version-payload'
Browse files Browse the repository at this point in the history
  • Loading branch information
matzew committed Oct 30, 2014
2 parents 00592ea + 434b272 commit 859b121
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
import java.nio.charset.Charset;
import java.util.Collection;

import javax.ws.rs.core.Response.Status;

import org.jboss.aerogear.unifiedpush.api.SimplePushVariant;
import org.jboss.aerogear.unifiedpush.api.Variant;
import org.jboss.aerogear.unifiedpush.message.UnifiedPushMessage;

@SenderType(SimplePushVariant.class)
public class SimplePushNotificationSender implements PushNotificationSender {

Expand Down Expand Up @@ -102,12 +108,15 @@ protected HttpURLConnection put(String url, String body) throws IOException {
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setFixedLengthStreamingMode(bytes.length);
conn.setRequestProperty("Accept", "application/x-www-form-urlencoded");
conn.setRequestProperty("Content-Length", Integer.toString(bytes.length));
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setRequestProperty("Accept", "*/*");
conn.setRequestMethod("PUT");
OutputStream out = null;
try {
out = conn.getOutputStream();
out.write(bytes);
out.flush();
} finally {
// in case something blows up, while writing
// the payload, we wanna close the stream:
Expand Down

0 comments on commit 859b121

Please sign in to comment.