From 7bdedbe624ceae5aa87109c8dbfec5f1f7e40c19 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Wed, 12 Sep 2018 02:36:55 +0100 Subject: [PATCH] Nullable route annotation (#4257) * Nullable route annotation * Fix comment to mention intranet example --- okhttp/src/main/java/okhttp3/Authenticator.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/okhttp/src/main/java/okhttp3/Authenticator.java b/okhttp/src/main/java/okhttp3/Authenticator.java index 9e34bc970..c8b2451b7 100644 --- a/okhttp/src/main/java/okhttp3/Authenticator.java +++ b/okhttp/src/main/java/okhttp3/Authenticator.java @@ -70,6 +70,13 @@ public interface Authenticator { /** * Returns a request that includes a credential to satisfy an authentication challenge in {@code * response}. Returns null if the challenge cannot be satisfied. + * + * The route is best effort, it currently may not always be provided even when logically + * available. It may also not be provided when an Authenticator is re-used manually in + * an application interceptor, e.g. implementing client specific retries. + * + * @param route The route for evaluating how to respond to a challenge e.g. via intranet. + * @param response The response containing the auth challenges to respond to. */ - @Nullable Request authenticate(Route route, Response response) throws IOException; + @Nullable Request authenticate(@Nullable Route route, Response response) throws IOException; }