fix: Immediately disconnect from announcements and social api end points (no future calls are expected soon after)

This commit is contained in:
LisoUseInAIKyrios 2024-04-08 22:25:14 +04:00
parent 2182db352e
commit 116ac59557
2 changed files with 3 additions and 3 deletions

View File

@ -304,8 +304,8 @@ class SocialLinksRoutes {
return NO_CONNECTION_STATIC_LINKS;
}
String jsonString = Requester.parseInputStreamAndClose(connection.getInputStream(), false);
JSONArray socials = new JSONObject(jsonString).getJSONArray("socials");
JSONObject json = Requester.parseJSONObjectAndDisconnect(connection);
JSONArray socials = json.getJSONArray("socials");
List<ReVancedSocialLink> links = new ArrayList<>();
for (int i = 0, length = socials.length(); i < length; i++) {

View File

@ -61,7 +61,7 @@ public final class AnnouncementsPatch {
return;
}
var jsonString = Requester.parseInputStreamAndClose(connection.getInputStream(), false);
var jsonString = Requester.parseStringAndDisconnect(connection);
// Parse the announcement. Fall-back to raw string if it fails.