From 26cce1faac909f761246814d7b6475709ab05544 Mon Sep 17 00:00:00 2001 From: Athou Date: Tue, 13 Oct 2026 11:10:17 +0200 Subject: [PATCH] we only need the response headers --- .../backend/service/PushNotificationService.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/commafeed-server/src/main/java/com/commafeed/backend/service/PushNotificationService.java b/commafeed-server/src/main/java/com/commafeed/backend/service/PushNotificationService.java index 0c2cbd92..93246251 100644 --- a/commafeed-server/src/main/java/com/commafeed/backend/service/PushNotificationService.java +++ b/commafeed-server/src/main/java/com/commafeed/backend/service/PushNotificationService.java @@ -19,11 +19,15 @@ import org.apache.commons.lang3.StringUtils; import org.apache.hc.client5.http.async.methods.SimpleHttpRequest; import org.apache.hc.client5.http.async.methods.SimpleHttpResponse; import org.apache.hc.client5.http.async.methods.SimpleRequestBuilder; +import org.apache.hc.client5.http.async.methods.SimpleRequestProducer; import org.apache.hc.client5.http.config.RequestConfig; import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient; import org.apache.hc.core5.http.ContentType; +import org.apache.hc.core5.http.HttpResponse; import org.apache.hc.core5.http.NameValuePair; import org.apache.hc.core5.http.message.BasicNameValuePair; +import org.apache.hc.core5.http.nio.entity.DiscardingEntityConsumer; +import org.apache.hc.core5.http.nio.support.BasicResponseConsumer; import org.apache.hc.core5.net.WWWFormCodec; import org.apache.hc.core5.util.Timeout; @@ -195,7 +199,14 @@ public class PushNotificationService { private void send(String name, SimpleHttpRequest request) throws IOException { try { - SimpleHttpResponse response = httpClient.execute(request, null).get(); + HttpResponse response = + httpClient + .execute( + SimpleRequestProducer.create(request), + new BasicResponseConsumer<>(new DiscardingEntityConsumer<>()), + null) + .get() + .getHead(); if (response.getCode() >= 400) { throw new PushNotificationException( name + " notification failed with status " + response.getCode());