File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/MongoDB.Driver/Core/Configuration Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1043,13 +1043,23 @@ private void ParseOption(string name, string value)
1043
1043
_minPoolSize = ParseInt32 ( name , value ) ;
1044
1044
break ;
1045
1045
case "proxyhost" :
1046
+ if ( ! string . IsNullOrEmpty ( _proxyHost ) )
1047
+ {
1048
+ throw new MongoConfigurationException ( "Multiple proxyHost options are not allowed." ) ;
1049
+ }
1050
+
1046
1051
_proxyHost = value ;
1047
1052
if ( _proxyHost . Length == 0 )
1048
1053
{
1049
1054
throw new MongoConfigurationException ( "proxyHost cannot be empty." ) ;
1050
1055
}
1051
1056
break ;
1052
1057
case "proxyport" :
1058
+ if ( _proxyPort != null )
1059
+ {
1060
+ throw new MongoConfigurationException ( "Multiple proxyPort options are not allowed." ) ;
1061
+ }
1062
+
1053
1063
var proxyPortValue = ParseInt32 ( name , value ) ;
1054
1064
if ( proxyPortValue is < 0 or > 65535 )
1055
1065
{
@@ -1058,13 +1068,23 @@ private void ParseOption(string name, string value)
1058
1068
_proxyPort = proxyPortValue ;
1059
1069
break ;
1060
1070
case "proxyusername" :
1071
+ if ( ! string . IsNullOrEmpty ( _proxyUsername ) )
1072
+ {
1073
+ throw new MongoConfigurationException ( "Multiple proxyUsername options are not allowed." ) ;
1074
+ }
1075
+
1061
1076
_proxyUsername = value ;
1062
1077
if ( _proxyUsername . Length == 0 )
1063
1078
{
1064
1079
throw new MongoConfigurationException ( "proxyUsername cannot be empty." ) ;
1065
1080
}
1066
1081
break ;
1067
1082
case "proxypassword" :
1083
+ if ( ! string . IsNullOrEmpty ( _proxyPassword ) )
1084
+ {
1085
+ throw new MongoConfigurationException ( "Multiple proxyPassword options are not allowed." ) ;
1086
+ }
1087
+
1068
1088
_proxyPassword = value ;
1069
1089
if ( _proxyPassword . Length == 0 )
1070
1090
{
You can’t perform that action at this time.
0 commit comments