mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-03 03:09:42 +00:00
rest: register method: non-capturing group for path regex outer group
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
76b0577cbd
commit
a6766fedf3
@ -255,9 +255,9 @@ sub register_method {
|
||||
foreach my $comp (split(/\/+/, $info->{path})) {
|
||||
die "$errprefix path compoment has zero length\n" if $comp eq '';
|
||||
my ($name, $regex);
|
||||
if ($comp =~ m/^\{(\w+)(:(.*))?\}$/) {
|
||||
if ($comp =~ m/^\{(\w+)(?::(.*))?\}$/) {
|
||||
$name = $1;
|
||||
$regex = $3 ? $3 : '\S+';
|
||||
$regex = $2 ? $2 : '\S+';
|
||||
push @$match_re, $regex;
|
||||
push @$match_name, $name;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user