Don't stumble over undefined request arguments

Don't yield an "unitialized value" error if Nginx didn't define the
method that returns the request arguments.
This commit is contained in:
Holger Weiss 2020-07-02 08:25:35 +02:00
parent bc00eeec60
commit c4d3486b12
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ sub handle_put {
my $uri = $r->uri =~ s|(?:/[^/]+){$uri_prefix_components}/||r; my $uri = $r->uri =~ s|(?:/[^/]+){$uri_prefix_components}/||r;
my $provided_hmac; my $provided_hmac;
if ($r->args =~ /v=([[:xdigit:]]{64})/) { if (defined($r->args) and $r->args =~ /v=([[:xdigit:]]{64})/) {
$provided_hmac = $1; $provided_hmac = $1;
} else { } else {
$r->log_error(0, 'Rejecting upload: No auth token provided'); $r->log_error(0, 'Rejecting upload: No auth token provided');