forked from loafle/openapi-generator-original
@@ -1165,8 +1165,10 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
try {
|
||||
response = sendRequest(method, invocationBuilder, entity);
|
||||
|
||||
final int statusCode = response.getStatusInfo().getStatusCode();
|
||||
|
||||
// If OAuth is used and a status 401 is received, renew the access token and retry the request
|
||||
if (response.getStatusInfo() == Status.UNAUTHORIZED) {
|
||||
if (statusCode == Status.UNAUTHORIZED.getStatusCode()) {
|
||||
for (String authName : authNames) {
|
||||
Authentication authentication = authentications.get(authName);
|
||||
if (authentication instanceof OAuth) {
|
||||
@@ -1181,10 +1183,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
}
|
||||
}
|
||||
|
||||
int statusCode = response.getStatusInfo().getStatusCode();
|
||||
Map<String, List<String>> responseHeaders = buildResponseHeaders(response);
|
||||
|
||||
if (response.getStatusInfo() == Status.NO_CONTENT) {
|
||||
if (statusCode == Status.NO_CONTENT.getStatusCode()) {
|
||||
return new ApiResponse<T>(statusCode, responseHeaders);
|
||||
} else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) {
|
||||
if (returnType == null) {
|
||||
|
||||
Reference in New Issue
Block a user