mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-07 01:23:33 +00:00
rest: register method: allow minus in path template parameter names
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
a6766fedf3
commit
dfc8643d65
@ -255,7 +255,7 @@ sub register_method {
|
|||||||
foreach my $comp (split(/\/+/, $info->{path})) {
|
foreach my $comp (split(/\/+/, $info->{path})) {
|
||||||
die "$errprefix path compoment has zero length\n" if $comp eq '';
|
die "$errprefix path compoment has zero length\n" if $comp eq '';
|
||||||
my ($name, $regex);
|
my ($name, $regex);
|
||||||
if ($comp =~ m/^\{(\w+)(?::(.*))?\}$/) {
|
if ($comp =~ m/^\{([\w-]+)(?::(.*))?\}$/) {
|
||||||
$name = $1;
|
$name = $1;
|
||||||
$regex = $2 ? $2 : '\S+';
|
$regex = $2 ? $2 : '\S+';
|
||||||
push @$match_re, $regex;
|
push @$match_re, $regex;
|
||||||
|
Loading…
Reference in New Issue
Block a user