epugh commented on PR #1954:
URL: https://github.com/apache/solr/pull/1954#issuecomment-1735521281
> re. this pattern of parsing `user:password`
>
> ```
> if (credentials != null && credentials.indexOf(":") > 0) {
> String[] credentialsArray = credentials.split(":");
> ```
>
> what happens if the password itself contains `:` (I don't think the
username is allowed to but I may be wrong). would it be a safer bet to break
the string in 2 parts on the first occurrence?
>
> [edit] turns out the solution to this was very simple, use
`credentials.split(":",2)`. this will force the split into 2 parts only.
your fix is nicer than mine!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]