From: Thomas Lamprecht Date: Tue, 17 Nov 2020 15:05:20 +0000 (+0100) Subject: rest: register method: allow minus in path template parameter names X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=dfc8643d65e89b5816ae2576e4c538bab1f84779 rest: register method: allow minus in path template parameter names Signed-off-by: Thomas Lamprecht --- diff --git a/src/PVE/RESTHandler.pm b/src/PVE/RESTHandler.pm index b0bb431..1eea32a 100644 --- a/src/PVE/RESTHandler.pm +++ b/src/PVE/RESTHandler.pm @@ -255,7 +255,7 @@ 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 = $2 ? $2 : '\S+'; push @$match_re, $regex;