Commit 056828b
committed
Fix $-pattern corruption of user_config values in replaceVariables
String.prototype.replace treats $ sequences ($&, $$, $`, $', $n) in the
replacement string as special patterns, so any user_config value containing a
$ — e.g. a password with $& in it — was silently corrupted before being
injected into mcp_config. The server then received wrong credentials.
Pass a replacement function so the value is inserted verbatim. Adds a
regression test covering $&, $$ and $n in a substituted value.1 parent 70fe3b3 commit 056828b
2 files changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
32 | 41 | | |
33 | 42 | | |
34 | 43 | | |
| |||
0 commit comments