Merge pull request #3409 from nextcloud/bugfix/3408/fixLoginFailWithUmlautInUsername

Bugfix/3408/fix login fail with umlaut in username
This commit is contained in:
Marcel Hibbe 2023-10-26 15:16:41 +02:00 committed by GitHub
commit 0de2600c51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 24 deletions

View File

@ -40,6 +40,7 @@ import java.io.IOException;
import java.net.CookieManager; import java.net.CookieManager;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.Proxy; import java.net.Proxy;
import java.nio.charset.StandardCharsets;
import java.security.KeyStore; import java.security.KeyStore;
import java.security.KeyStoreException; import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
@ -209,9 +210,12 @@ public class RestModule {
if (appPreferences.getProxyCredentials() && if (appPreferences.getProxyCredentials() &&
!TextUtils.isEmpty(appPreferences.getProxyUsername()) && !TextUtils.isEmpty(appPreferences.getProxyUsername()) &&
!TextUtils.isEmpty(appPreferences.getProxyPassword())) { !TextUtils.isEmpty(appPreferences.getProxyPassword())) {
httpClient.proxyAuthenticator(new HttpAuthenticator(Credentials.basic( httpClient.proxyAuthenticator(new HttpAuthenticator(
Credentials.basic(
appPreferences.getProxyUsername(), appPreferences.getProxyUsername(),
appPreferences.getProxyPassword()), "Proxy-Authorization")); appPreferences.getProxyPassword(),
StandardCharsets.UTF_8),
"Proxy-Authorization"));
} }
} }

View File

@ -34,6 +34,7 @@ import com.nextcloud.talk.data.user.model.User;
import com.nextcloud.talk.models.RetrofitBucket; import com.nextcloud.talk.models.RetrofitBucket;
import com.nextcloud.talk.utils.database.user.CapabilitiesUtilNew; import com.nextcloud.talk.utils.database.user.CapabilitiesUtilNew;
import java.nio.charset.StandardCharsets;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -60,8 +61,8 @@ public class ApiUtils {
} }
/** /**
* @deprecated This is only supported on API v1-3, in API v4+ please use {@link ApiUtils#getUrlForAttendees(int, * @deprecated This is only supported on API v1-3, in API v4+ please use
* String, String)} instead. * {@link ApiUtils#getUrlForAttendees(int, String, String)} instead.
*/ */
@Deprecated @Deprecated
public static String getUrlForRemovingParticipantFromConversation(String baseUrl, String roomToken, boolean isGuest) { public static String getUrlForRemovingParticipantFromConversation(String baseUrl, String roomToken, boolean isGuest) {
@ -399,7 +400,7 @@ public class ApiUtils {
if (TextUtils.isEmpty(username) && TextUtils.isEmpty(token)) { if (TextUtils.isEmpty(username) && TextUtils.isEmpty(token)) {
return null; return null;
} }
return Credentials.basic(username, token); return Credentials.basic(username, token, StandardCharsets.UTF_8);
} }
public static String getUrlNextcloudPush(String baseUrl) { public static String getUrlNextcloudPush(String baseUrl) {