Improve UD handling for fallback REST sends.

Special thanks to @stevie553 for the wonderfully-detailed bug report!

Fixes #11991
fork-5.53.8
Greyson Parrelli 2022-02-14 14:58:09 -05:00
rodzic e2aec496c5
commit 267897b133
1 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -515,10 +515,12 @@ public class PushServiceSocket {
throws IOException
{
try {
String responseText = makeServiceRequest(String.format(MESSAGE_PATH, bundle.getDestination()), "PUT", JsonUtil.toJson(bundle), NO_HEADERS, unidentifiedAccess);
String responseText = makeServiceRequest(String.format(MESSAGE_PATH, bundle.getDestination()), "PUT", JsonUtil.toJson(bundle), NO_HEADERS, unidentifiedAccess);
SendMessageResponse response = JsonUtil.fromJson(responseText, SendMessageResponse.class);
if (responseText == null) return new SendMessageResponse(false, unidentifiedAccess.isPresent());
else return JsonUtil.fromJson(responseText, SendMessageResponse.class);
response.setSentUnidentfied(unidentifiedAccess.isPresent());
return response;
} catch (NotFoundException nfe) {
throw new UnregisteredUserException(bundle.getDestination(), nfe);
}