Merge pull request #1097 from DeterminateSystems/api-test-warnings

Api test warnings: clean up
This commit is contained in:
Graham Christensen
2022-01-10 14:03:38 -05:00
committed by GitHub
2 changed files with 3 additions and 4 deletions

View File

@ -42,12 +42,11 @@ sub request_json {
$req->uri("http://localhost$opts->{uri}");
$req->header(Accept => "application/json");
$req->header(Content_Type => "application/json");
$req->header(Origin => "http://localhost/") if $opts->{method} eq "POST";
$req->header(Origin => "http://localhost/") if ($opts->{method} // "") eq "POST";
$req->header(Cookie => $cookie);
$req->content(encode_json($opts->{data})) if defined $opts->{data};
my $res = request($req);
print $res->as_string();
return $res;
}