Fix regex operator precedence bug in API method guard

Fix regex operator precedence bug in API method guard
This commit is contained in:
Kevin Scott Adams 2026-05-18 17:13:48 -04:00 committed by GitHub
commit 8a5fb01080
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -466,7 +466,7 @@ sub freenas_api_call {
syslog("info", (caller(0))[3] . " : called for host '" . $apihost . "'");
$method = uc($method);
if (! $method =~ /^(?>GET|DELETE|POST)$/) {
if ($method !~ /^(?:GET|DELETE|POST)$/) {
syslog("info", (caller(0))[3] . " : Invalid HTTP RESTful service method '$method'");
die "Invalid HTTP RESTful service method '$method' used.";
}