Skip to content

Commit

Permalink
Fix password protected feeds (#7155)
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteHamster committed May 1, 2024
1 parent 3ed5b8a commit 19396c1
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -67,6 +67,7 @@ public Response intercept(Chain chain) throws IOException {

Log.d(TAG, "Authorization failed, re-trying with ISO-8859-1 encoded credentials");
newRequest.header(HEADER_AUTHORIZATION, HttpCredentialEncoder.encode(username, password, "ISO-8859-1"));
response.close();
response = chain.proceed(newRequest.build());

if (response.code() != HttpURLConnection.HTTP_UNAUTHORIZED) {
Expand All @@ -75,6 +76,7 @@ public Response intercept(Chain chain) throws IOException {

Log.d(TAG, "Authorization failed, re-trying with UTF-8 encoded credentials");
newRequest.header(HEADER_AUTHORIZATION, HttpCredentialEncoder.encode(username, password, "UTF-8"));
response.close();
return chain.proceed(newRequest.build());
}
}

0 comments on commit 19396c1

Please sign in to comment.