Skip to content

Commit 92ab39d

Browse files
committed
httpclient didn't release when http validateResponse false.
1 parent ba59d40 commit 92ab39d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ target
55
.project
66
.settings
77
test-output
8+
.DS_Store

jenkins-client/src/main/java/com/offbytwo/jenkins/client/JenkinsHttpClient.java

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ public String post_xml(String path, String xml_data, boolean crumbFlag) throws I
339339
}
340340
HttpResponse response = client.execute(request, localContext);
341341
getJenkinsVersionFromHeader(response);
342-
httpResponseValidator.validateResponse(response);
343342
try {
343+
httpResponseValidator.validateResponse(response);
344344
return IOUtils.toString(response.getEntity().getContent());
345345
} finally {
346346
EntityUtils.consume(response.getEntity());
@@ -386,8 +386,8 @@ public String post_text(String path, String textData, ContentType contentType, b
386386
}
387387
HttpResponse response = client.execute(request, localContext);
388388
getJenkinsVersionFromHeader(response);
389-
httpResponseValidator.validateResponse(response);
390389
try {
390+
httpResponseValidator.validateResponse(response);
391391
return IOUtils.toString(response.getEntity().getContent());
392392
} finally {
393393
EntityUtils.consume(response.getEntity());

0 commit comments

Comments
 (0)