Skip to content

Commit f7f18d6

Browse files
committed
Restored GetAuthMechanismProperties
1 parent b1fb702 commit f7f18d6

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

Diff for: src/MongoDB.Driver/Core/Configuration/ConnectionString.cs

+4-12
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ private void ParseOption(string name, string value)
926926
_authMechanism = value;
927927
break;
928928
case "authmechanismproperties":
929-
foreach (var property in GetAuthMechanismProperties(name, value, _isInternalRepresentation))
929+
foreach (var property in GetAuthMechanismProperties(name, value))
930930
{
931931
_authMechanismProperties.Add(property.Key, property.Value);
932932
}
@@ -1129,19 +1129,11 @@ private void ParseOption(string name, string value)
11291129
}
11301130

11311131
// private static methods
1132-
private static IEnumerable<KeyValuePair<string, string>> GetAuthMechanismProperties(string name, string value, bool isEscaped = false)
1132+
private static IEnumerable<KeyValuePair<string, string>> GetAuthMechanismProperties(string name, string value)
11331133
{
1134-
if (isEscaped)
1134+
foreach (var property in value.Split(','))
11351135
{
1136-
value = Uri.UnescapeDataString(value);
1137-
}
1138-
1139-
// The regex splits at commas that are followed by a word and a colon
1140-
var parts = isEscaped ? Regex.Split(value, @",(?=\w+:)") : value.Split(',');
1141-
1142-
foreach (var part in parts)
1143-
{
1144-
var unescapedProperty = isEscaped ? part : Uri.UnescapeDataString(part);
1136+
var unescapedProperty = Uri.UnescapeDataString(property);
11451137
var separatorPosition = unescapedProperty.IndexOf(':');
11461138
if (separatorPosition == -1)
11471139
{

0 commit comments

Comments
 (0)