Skip to content

Commit

Permalink
Merge pull request #2103 from arunans23/master
Browse files Browse the repository at this point in the history
Update the URL pattern regex to correctly mask the SMB2 passwords
  • Loading branch information
arunans23 authored Sep 26, 2023
2 parents 0695326 + 663e5f2 commit f63772c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class VFSUtils {
/**
* URL pattern
*/
private static final Pattern URL_PATTERN = Pattern.compile("[a-z]+://.*");
private static final Pattern URL_PATTERN = Pattern.compile("[a-zA-Z0-9]+://.*");

/**
* Password pattern
Expand Down Expand Up @@ -350,7 +350,7 @@ public static String maskURLPassword(String url) {
String maskUrl;
if (urlMatcher.find()) {
final Matcher pwdMatcher = PASSWORD_PATTERN.matcher(url);
maskUrl = pwdMatcher.replaceFirst("\":***@\"");
maskUrl = pwdMatcher.replaceFirst(":***@");
return maskUrl;
}
return url;
Expand Down

0 comments on commit f63772c

Please sign in to comment.