Commit a2e65d8
committed
Fix IllegalArgumentException when credentials contain $ or \
The withAuthentication() method uses String.replaceFirst() to inject
credentials into the repository URL. The credentials string is used
directly as the replacement argument, but in Java regex replacements
$ and \ are special characters (group references and escape sequences).
If a password contains $ (e.g. "pa$$word"), replaceFirst() throws
java.lang.IllegalArgumentException: Illegal group reference.
Fix: wrap credentials with Matcher.quoteReplacement() to escape any
regex-special characters before using them in the replacement string.
Made-with: Cursor1 parent 8ad40ad commit a2e65d8
1 file changed
Lines changed: 2 additions & 1 deletion
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | | - | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| |||
0 commit comments