fix: rewrites/redirects do not capture glob groups correctly (#265)
by removing the non-capturing group that appeared during the glob to regex conversion.
the following glob example works now
```toml
[advanced]
[[advanced.rewrites]]
source = "/files/{*}"
destination = "/$1"
```
Diff
src/settings/mod.rs | 16 ++++++++++++----
tests/toml/config.toml | 4 ++++
2 files changed, 16 insertions(+), 4 deletions(-)
@@ -342,8 +342,12 @@ impl Settings {
})?
.compile_matcher();
let pattern =
source.glob().regex().trim_start_matches("(?-u)").to_owned();
let pattern = source
.glob()
.regex()
.trim_start_matches("(?-u)")
.replace("?:.*", ".*")
.to_owned();
tracing::debug!(
"url rewrites glob pattern: {}",
&rewrites_entry.source
@@ -384,8 +388,12 @@ impl Settings {
})?
.compile_matcher();
let pattern =
source.glob().regex().trim_start_matches("(?-u)").to_owned();
let pattern = source
.glob()
.regex()
.trim_start_matches("(?-u)")
.replace("?:.*", ".*")
.to_owned();
tracing::debug!(
"url redirects glob pattern: {}",
&redirects_entry.source
@@ -127,6 +127,10 @@ destination = "/assets/$1.$2"
source = "/abc/**/*.{svg,jxl}"
destination = "/assets/favicon.ico"
[[advanced.rewrites]]
source = "/files/{*}"
destination = "/$1"
[[advanced.virtual-hosts]]