mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
Use UTF_8 for basic authorization
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
3db8baabe4
commit
e5788016cf
@ -40,6 +40,7 @@ import java.io.IOException;
|
||||
import java.net.CookieManager;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Proxy;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.KeyStore;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
@ -209,9 +210,12 @@ public class RestModule {
|
||||
if (appPreferences.getProxyCredentials() &&
|
||||
!TextUtils.isEmpty(appPreferences.getProxyUsername()) &&
|
||||
!TextUtils.isEmpty(appPreferences.getProxyPassword())) {
|
||||
httpClient.proxyAuthenticator(new HttpAuthenticator(Credentials.basic(
|
||||
appPreferences.getProxyUsername(),
|
||||
appPreferences.getProxyPassword()), "Proxy-Authorization"));
|
||||
httpClient.proxyAuthenticator(new HttpAuthenticator(
|
||||
Credentials.basic(
|
||||
appPreferences.getProxyUsername(),
|
||||
appPreferences.getProxyPassword(),
|
||||
StandardCharsets.UTF_8),
|
||||
"Proxy-Authorization"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ import com.nextcloud.talk.data.user.model.User;
|
||||
import com.nextcloud.talk.models.RetrofitBucket;
|
||||
import com.nextcloud.talk.utils.database.user.CapabilitiesUtilNew;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -399,7 +400,7 @@ public class ApiUtils {
|
||||
if (TextUtils.isEmpty(username) && TextUtils.isEmpty(token)) {
|
||||
return null;
|
||||
}
|
||||
return Credentials.basic(username, token);
|
||||
return Credentials.basic(username, token, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
public static String getUrlNextcloudPush(String baseUrl) {
|
||||
|
Loading…
Reference in New Issue
Block a user