Commit fd732644 authored by Roman Lacko's avatar Roman Lacko Committed by Fakultni administrativa
Browse files

API.pm: undef query parameters should not be considered "extra"

parent 78f7852c
......@@ -162,7 +162,7 @@ sub create_uri {
# add query parameters
foreach my $param (@{$tmpl->{query} // []}) {
if (defined $args->{$param}) {
if (exists $args->{$param}) {
$uri->query_param($param => $args->{$param});
delete $args->{$param};
}
......@@ -201,10 +201,18 @@ sub exec_request {
delete @{$args}{@rtkeys};
if ($log->is_debug) {
my $argstr = join ", ", map { "$_ => " . ($_ eq "password" ? "<redacted>" : "\"$args->{$_}\"") } (keys %$args);
my $rtstr = join ", ", map { "$_ => $rtargs->{$_}" } (@rtkeys);
$log->debug("called GitLab::API::$tmpl->{name}($argstr)");
$log->debug("request options: [$rtstr]");
my @bits;
for my $key (keys %$args) {
my $value = $key eq "password" ? "<redacted>"
: !defined $args->{$key} ? "<undef>"
: "\"$args->{$key}\"";
push @bits, "$key => $value";
}
push @bits, "[$_ => $rtargs->{$_}]" foreach @rtkeys;
$log->debug("called GitLab::API::$tmpl->{name}(" . (join ", ", @bits) . ")");
}
my $uri = $self->create_uri($tmpl, $args);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment