Fix password protected feeds (#7155)

This commit is contained in:
ByteHamster 2024-05-01 11:52:46 +02:00 committed by GitHub
parent 3ed5b8af8c
commit 19396c1e17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -67,6 +67,7 @@ public class BasicAuthorizationInterceptor implements Interceptor {
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) {
@ -75,6 +76,7 @@ public class BasicAuthorizationInterceptor implements Interceptor {
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());
}
}