Skip to content

Commit 4601429

Browse files
committed
Fix connections to server on different locales
* ToUpper is not enough, we need to use InvariantCulture to be sure that the string is converted to uppercase in a way that is consistent with the server.
1 parent 90a6752 commit 4601429

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

RabbitMQ.Stream.Client/Client.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ await client
222222
.ConfigureAwait(false);
223223
logger?.LogDebug("Sasl mechanism: {Mechanisms}", saslHandshakeResponse.Mechanisms);
224224

225-
var isValid = saslHandshakeResponse.Mechanisms.Contains(parameters.AuthMechanism.ToString().ToUpper(),
225+
var isValid = saslHandshakeResponse.Mechanisms.Contains(parameters.AuthMechanism.ToString().ToUpperInvariant(),
226226
StringComparer.OrdinalIgnoreCase);
227227
if (!isValid)
228228
{
@@ -234,7 +234,7 @@ await client
234234
var authResponse =
235235
await client
236236
.Request<SaslAuthenticateRequest, SaslAuthenticateResponse>(corr =>
237-
new SaslAuthenticateRequest(corr, parameters.AuthMechanism.ToString().ToUpper(), saslData))
237+
new SaslAuthenticateRequest(corr, parameters.AuthMechanism.ToString().ToUpperInvariant(), saslData))
238238
.ConfigureAwait(false);
239239
ClientExceptions.MaybeThrowException(authResponse.ResponseCode, parameters.UserName);
240240

0 commit comments

Comments
 (0)