mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-27 21:29:47 +01:00
Ensure response body is closed when a http request is not successful (#1912)
This commit is contained in:
parent
b73b73e221
commit
352f3bd263
@ -46,6 +46,7 @@ public class AbstractHttpClient {
|
||||
protected Response makeHttpRequest(Request request) throws IOException {
|
||||
Response response = this.okHttp.newCall(request).execute();
|
||||
if (!response.isSuccessful()) {
|
||||
response.close();
|
||||
throw new RuntimeException("Request was unsuccessful: " + response.code() + " - " + response.message());
|
||||
}
|
||||
return response;
|
||||
|
Loading…
Reference in New Issue
Block a user