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.
|
* 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.
|
* The regex group of the username.
|
||||||
@@ -107,8 +107,10 @@ public class QCParser {
|
|||||||
if (userInfo != null && !userInfo.equals("")) {
|
if (userInfo != null && !userInfo.equals("")) {
|
||||||
|
|
||||||
Matcher userinfoMatcher = userinfoPattern.matcher(userInfo);
|
Matcher userinfoMatcher = userinfoPattern.matcher(userInfo);
|
||||||
username = userinfoMatcher.group(USERNAME_GROUP);
|
if (userinfoMatcher.matches()) {
|
||||||
password = userinfoMatcher.group(PASSWORD_GROUP);
|
username = userinfoMatcher.group(USERNAME_GROUP);
|
||||||
|
password = userinfoMatcher.group(PASSWORD_GROUP);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user