See gh-18281
This commit is contained in:
Johnny Lim
2019-09-19 13:12:44 +09:00
committed by Stephane Nicoll
parent 9f1243129c
commit b70be97cbf
6 changed files with 8 additions and 7 deletions

View File

@@ -101,10 +101,11 @@ public class Sanitizer {
}
private Object sanitizeUri(Object value) {
Matcher matcher = URI_USERINFO_PATTERN.matcher(value.toString());
String uriString = value.toString();
Matcher matcher = URI_USERINFO_PATTERN.matcher(uriString);
String password = matcher.matches() ? matcher.group(1) : null;
if (password != null) {
return StringUtils.replace(value.toString(), ":" + password + "@", ":******@");
return StringUtils.replace(uriString, ":" + password + "@", ":******@");
}
return value;
}