mirror of
https://github.com/Fishwaldo/rundeck-api-java-client.git
synced 2025-07-08 05:58:39 +00:00
remove workaround for a bug fixed in 1.3 (see http://rundeck.lighthouseapp.com/projects/59277/tickets/248 )
This commit is contained in:
parent
3ad214d498
commit
e5cb20a03c
1 changed files with 0 additions and 19 deletions
|
@ -225,25 +225,6 @@ class ApiCall {
|
||||||
+ request.getURI(), e);
|
+ request.getURI(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTTP client refuses to handle redirects (code 3xx) for DELETE, so we have to do it manually...
|
|
||||||
// See http://rundeck.lighthouseapp.com/projects/59277/tickets/248
|
|
||||||
if (response.getStatusLine().getStatusCode() / 100 == 3
|
|
||||||
&& HttpDelete.METHOD_NAME.equals(request.getMethod())) {
|
|
||||||
String newLocation = response.getFirstHeader("Location").getValue();
|
|
||||||
try {
|
|
||||||
EntityUtils.consume(response.getEntity());
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RundeckApiException("Failed to consume entity (release connection)", e);
|
|
||||||
}
|
|
||||||
request = new HttpDelete(newLocation);
|
|
||||||
try {
|
|
||||||
response = httpClient.execute(request);
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RundeckApiException("Failed to execute an HTTP " + request.getMethod() + " on url : "
|
|
||||||
+ request.getURI(), e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// in case of error, we get a redirect to /api/error
|
// in case of error, we get a redirect to /api/error
|
||||||
// that we need to follow manually for POST and DELETE requests (as GET)
|
// that we need to follow manually for POST and DELETE requests (as GET)
|
||||||
if (response.getStatusLine().getStatusCode() / 100 == 3) {
|
if (response.getStatusLine().getStatusCode() / 100 == 3) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue