Push service release version 4
This commit is contained in:
@@ -59,6 +59,13 @@ public class ExternalPushServiceResponseHandler {
|
||||
|
||||
updateSubscription(subscription);
|
||||
break;
|
||||
case 403: // Forbidden
|
||||
// also "SENDER_ID_MISMATCH" - may happen if the VAPID keys were changed -> subscription needs to be removed
|
||||
// AND CLIENT NEEDS TO RE-SUBSCRIBE (not sure how to control that from here, though)
|
||||
LOGGER.error(String.format("Received 403 for endpoint %s", subscription.getEndpoint()));
|
||||
|
||||
deleteSubscription(subscription);
|
||||
break;
|
||||
case 404: // Not found
|
||||
// Subscription expired or endpoint is wrong -> subscription needs to be removed
|
||||
LOGGER.info(String.format("Received 404 for endpoint %s", subscription.getEndpoint()));
|
||||
@@ -80,6 +87,8 @@ public class ExternalPushServiceResponseHandler {
|
||||
updateSubscription(subscription);
|
||||
break;
|
||||
default:
|
||||
LOGGER.error(String.format("Unhandled HTTP response code: %s for endpoint %s",
|
||||
response.getStatusLine().getStatusCode(), subscription.getEndpoint()));
|
||||
}
|
||||
} catch (InterruptedException ire) {
|
||||
LOGGER.error(String.format("Thread interrupted for endpoint %s", subscription.getEndpoint()));
|
||||
|
||||
Reference in New Issue
Block a user