Azure / azure-notificationhubs-java-backend

Azure Notification Hubs SDK for Java
https://docs.microsoft.com/en-us/azure/notification-hubs/
Apache License 2.0
35 stars 49 forks source link

createWindowsNotification doesn't add X-WNS-Type header when the message body has xml prolog #86

Closed daatlk closed 3 years ago

daatlk commented 3 years ago

This method has been changed recently to replace contains checks with regex.

However a regex like *"^<toast[\s\S]>[\s\S]+$"** does not match when the message body has a xml prolog. Also noted this regex seems correct in other languages.

ex message body from test send in Azure portal


<?xml version="1.0" encoding="utf-8"?>
<toast>
<visual><binding template="ToastText01">
<text id="1">Test message</text>
</binding>
</visual>
</toast>

Tried "\s<toast[\s\S]>[\s\S]+$" and it seems to work with java regex.

mpodwysocki commented 3 years ago

Closed as per #90