Skip to content

Commit b5f7308

Browse files
committed
fix: check if the request comes from TokenRequestRemoteOperation instead of checking for an authorization header
1 parent 10bd79e commit b5f7308

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class OwnCloudClient extends HttpClient {
5353
public static final String WEBDAV_FILES_PATH_4_0 = "/remote.php/dav/files/";
5454
public static final String STATUS_PATH = "/status.php";
5555
private static final String WEBDAV_UPLOADS_PATH_4_0 = "/remote.php/dav/uploads/";
56+
private static final String KONNECT_V1_TOKEN_PATH = "/konnect/v1/token";
5657
private static final int MAX_RETRY_COUNT = 2;
5758

5859
private static int sIntanceCounter = 0;
@@ -132,7 +133,7 @@ private int saveExecuteHttpMethod(HttpBaseMethod method) throws Exception {
132133
method.setRequestHeader(HttpConstants.ACCEPT_LANGUAGE_HEADER, Locale.getDefault().getLanguage());
133134
method.setRequestHeader(HttpConstants.ACCEPT_ENCODING_HEADER, HttpConstants.ACCEPT_ENCODING_IDENTITY);
134135
if (mCredentials.getHeaderAuth() != null && !mCredentials.getHeaderAuth().isEmpty()
135-
&& method.getRequest().header(AUTHORIZATION_HEADER) == null) {
136+
&& !method.getHttpUrl().encodedPath().equals(KONNECT_V1_TOKEN_PATH)) {
136137
method.setRequestHeader(AUTHORIZATION_HEADER, mCredentials.getHeaderAuth());
137138
}
138139

0 commit comments

Comments
 (0)