From cf0f0b14fc8e61124cb0db6f4fdc9a10659c1be3 Mon Sep 17 00:00:00 2001 From: caneleex Date: Sat, 24 Jul 2021 16:57:42 +0200 Subject: [PATCH] fix requests not sending sometimes --- integrations/java/pl/jakubweg/requests/Requester.java | 1 + 1 file changed, 1 insertion(+) diff --git a/integrations/java/pl/jakubweg/requests/Requester.java b/integrations/java/pl/jakubweg/requests/Requester.java index 109551800..b3ae0cd11 100644 --- a/integrations/java/pl/jakubweg/requests/Requester.java +++ b/integrations/java/pl/jakubweg/requests/Requester.java @@ -184,6 +184,7 @@ public class Requester { String url = SPONSORBLOCK_API_URL + route.compile(params).getCompiledRoute(); HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(); connection.setRequestMethod(route.getMethod().name()); + connection.getInputStream().close(); // this is required so it properly establishes the connection when not reading the InputStream in any of the routes return connection; }