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

Commit

Permalink
fix: πŸ› webpush messages were not UTF-8 encoded
Browse files Browse the repository at this point in the history
Webpush messages was encoded using the default encoding, thus generating
errors when sending UTF-8 texts
  • Loading branch information
ziccardi committed Jan 8, 2021
1 parent a522af7 commit 716c243
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void sendPushMessage(final Variant variant, final Collection<String> toke

try {
final Notification notification = new Notification(registration.getEndpoint(), getUserPublicKey(registration),
registration.getAuthAsBytes(), gson.toJson(pushMessage.getMessage()).getBytes());
registration.getAuthAsBytes(), gson.toJson(pushMessage.getMessage()).getBytes("UTF-8"));

final HttpResponse response = webPushService.send(notification);
final int responseCode = response.getStatusLine().getStatusCode();
Expand Down

0 comments on commit 716c243

Please sign in to comment.