mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-38: Tweak to regex and correct behavior of matcher.
This commit is contained in:
@@ -49,7 +49,7 @@ public class QCParser {
|
||||
/**
|
||||
* The regex to use to split username and password.
|
||||
*/
|
||||
private static final Pattern userinfoPattern = Pattern.compile("(^[^:]+):(.*)");
|
||||
private static final Pattern userinfoPattern = Pattern.compile("(^[^:]+):?(.*)");
|
||||
|
||||
/**
|
||||
* The regex group of the username.
|
||||
@@ -107,8 +107,10 @@ public class QCParser {
|
||||
if (userInfo != null && !userInfo.equals("")) {
|
||||
|
||||
Matcher userinfoMatcher = userinfoPattern.matcher(userInfo);
|
||||
username = userinfoMatcher.group(USERNAME_GROUP);
|
||||
password = userinfoMatcher.group(PASSWORD_GROUP);
|
||||
if (userinfoMatcher.matches()) {
|
||||
username = userinfoMatcher.group(USERNAME_GROUP);
|
||||
password = userinfoMatcher.group(PASSWORD_GROUP);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user