diff --git a/t/api-test.t b/t/api-test.t index bd26d487..08d52dc1 100644 --- a/t/api-test.t +++ b/t/api-test.t @@ -42,7 +42,7 @@ 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};