File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
connectors/http-connector/src/main/java/org/openstack4j/connectors/http Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,15 @@ private <R> HttpResponse invokeRequest(HttpCommand<R> command) throws Exception
5959 HttpResponse response = command .execute ();
6060
6161 if (command .getRetries () == 0 && response .getStatus () == 401 && !command .getRequest ().getHeaders ().containsKey (ClientConstants .HEADER_OS4J_AUTH )) {
62- OSAuthenticator .reAuthenticate ();
63- command .getRequest ().getHeaders ().put (ClientConstants .HEADER_X_AUTH_TOKEN , OSClientSession .getCurrent ().getTokenId ());
64- return invokeRequest (command .incrementRetriesAndReturn ());
62+ try
63+ {
64+ OSAuthenticator .reAuthenticate ();
65+ command .getRequest ().getHeaders ().put (ClientConstants .HEADER_X_AUTH_TOKEN , OSClientSession .getCurrent ().getTokenId ());
66+ return invokeRequest (command .incrementRetriesAndReturn ());
67+ }
68+ finally {
69+ response .close ();
70+ }
6571 }
6672 return response ;
6773 }
You can’t perform that action at this time.
0 commit comments