Commit 91be2974 authored by Ricki Hirner's avatar Ricki Hirner

Upgrade to okhttp 3.6.0 and gradle 3.3

parent ea8f1e4d
Pipeline #6112248 passed with stage
in 4 minutes and 39 seconds
......@@ -50,14 +50,14 @@ android {
dependencies {
compile 'com.android.support:support-annotations:25.+'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.squareup.okhttp3:okhttp:3.5.0'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
provided 'org.projectlombok:lombok:1.16.12'
androidTestCompile 'com.squareup.okhttp3:mockwebserver:3.5.0'
androidTestCompile 'com.squareup.okhttp3:mockwebserver:3.6.0'
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:runner:+'
testCompile 'junit:junit:4.12'
testCompile 'com.squareup.okhttp3:mockwebserver:3.5.0'
testCompile 'com.squareup.okhttp3:mockwebserver:3.6.0'
}
......@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
......@@ -11,15 +11,20 @@ package at.bitfire.dav4android;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import org.apache.commons.lang3.CharSet;
import org.apache.commons.lang3.CharSetUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.LinkedList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import okhttp3.Authenticator;
import okhttp3.Credentials;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.RequestBody;
......@@ -120,9 +125,8 @@ public class BasicDigestAuthHandler implements Authenticator, Interceptor {
So, UTF-8 encoding for credentials is compatible with all RFC 7617 servers and many,
but not all pre-RFC 7617 servers. */
final String credentials = username + ":" + password;
return request.newBuilder()
.header(HEADER_AUTHORIZATION, "Basic " + ByteString.of(credentials.getBytes()).base64())
.header(HEADER_AUTHORIZATION, Credentials.basic(username, password, Charset.forName("UTF-8")))
.build();
} else if (response != null)
Constants.log.warning("No supported authentication scheme");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment