Skip to content

Commit

Permalink
Update ApiContext once restarted. (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
OGKevin committed May 29, 2018
1 parent ec3671c commit b0b82cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/bunq/sdk/http/ApiClient.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.bunq.sdk.http;

import com.bunq.sdk.context.ApiContext;
import com.bunq.sdk.context.BunqContext;
import com.bunq.sdk.context.InstallationContext;
import com.bunq.sdk.exception.ApiException;
import com.bunq.sdk.exception.BunqException;
Expand Down Expand Up @@ -242,8 +243,8 @@ private Response executeRequest(
Map<String, String> customHeaders,
String uri
) throws IOException {
if (!URIS_NOT_REQUIRING_ACTIVE_SESSION.contains(uri)) {
apiContext.ensureSessionActive();
if (!URIS_NOT_REQUIRING_ACTIVE_SESSION.contains(uri) && apiContext.ensureSessionActive()) {
BunqContext.updateApiContext(apiContext);
}

setHeaders(request, customHeaders);
Expand Down

0 comments on commit b0b82cc

Please sign in to comment.