Skip to content

Commit 6610aa7

Browse files
authored
Limit splitting auth info to a max of 2 parts (#1880)
Auth info after the first colon must be considered as the password. See IETF's rfc7617 (Basic Auth) for more details.
1 parent f3010e2 commit 6610aa7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Confluent.SchemaRegistry/CachedSchemaRegistryClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public CachedSchemaRegistryClient(IEnumerable<KeyValuePair<string, string>> conf
164164
{
165165
if (basicAuthInfo != "")
166166
{
167-
var userPass = (basicAuthInfo).Split(':');
167+
var userPass = basicAuthInfo.Split(new char[] { ':' }, 2);
168168
if (userPass.Length != 2)
169169
{
170170
throw new ArgumentException($"Configuration property {SchemaRegistryConfig.PropertyNames.SchemaRegistryBasicAuthUserInfo} must be of the form 'username:password'.");

0 commit comments

Comments
 (0)