aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2013-08-21 16:19:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-08-21 16:19:07 +0000
commit06672b78f27545ea2d9bec92f6294ba68003bd9b (patch)
treec41066c52bc322c2b94e56b7bc859e93f1469264
parente9b2610e627486d902b141fd8ac4cca574425610 (diff)
parent123333e7759f91b846c58849469b9d0ab21213f6 (diff)
downloadokhttp-06672b78f27545ea2d9bec92f6294ba68003bd9b.tar.gz
Merge "Don't support anything other than Basic auth." into klp-devandroid-4.4_r0.7
-rw-r--r--src/main/java/com/squareup/okhttp/internal/http/HttpAuthenticator.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/squareup/okhttp/internal/http/HttpAuthenticator.java b/src/main/java/com/squareup/okhttp/internal/http/HttpAuthenticator.java
index 566431e..63f39e4 100644
--- a/src/main/java/com/squareup/okhttp/internal/http/HttpAuthenticator.java
+++ b/src/main/java/com/squareup/okhttp/internal/http/HttpAuthenticator.java
@@ -39,6 +39,10 @@ public final class HttpAuthenticator {
@Override public Credential authenticate(
Proxy proxy, URL url, List<Challenge> challenges) throws IOException {
for (Challenge challenge : challenges) {
+ if (!"Basic".equals(challenge.getScheme())) {
+ continue;
+ }
+
PasswordAuthentication auth = Authenticator.requestPasswordAuthentication(url.getHost(),
getConnectToInetAddress(proxy, url), url.getPort(), url.getProtocol(),
challenge.getRealm(), challenge.getScheme(), url, Authenticator.RequestorType.SERVER);
@@ -52,6 +56,10 @@ public final class HttpAuthenticator {
@Override public Credential authenticateProxy(
Proxy proxy, URL url, List<Challenge> challenges) throws IOException {
for (Challenge challenge : challenges) {
+ if (!"Basic".equals(challenge.getScheme())) {
+ continue;
+ }
+
InetSocketAddress proxyAddress = (InetSocketAddress) proxy.address();
PasswordAuthentication auth = Authenticator.requestPasswordAuthentication(
proxyAddress.getHostName(), getConnectToInetAddress(proxy, url), proxyAddress.getPort(),