Commit 399c852
BUG/MINOR: fix regsub backreference in RequestRedirect ReplacePrefixMatch
HAProxy's regsub converter does not support backreferences in the
substitution string. The generated expression
%[path,regsub(^/old(/.*)?\$,/new\1)]
caused a parse error: 'missing arguments (got 1/2)' because \1 is not
a valid substitution in regsub.
regsub replaces only the matched portion of the string and leaves the
remainder intact, so no capture group is needed. Use the simpler form:
%[path,regsub(^/old,/new)]1 parent 370e8f6 commit 399c852
2 files changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
387 | | - | |
| 387 | + | |
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| |||
0 commit comments