From cc866bff1e9b294dade27311e637b43ec9bb8543 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 27 Oct 2016 13:15:09 +0200 Subject: [PATCH] Fix API tests POST requests require a referrer now. http://hydra.nixos.org/build/42775011 --- tests/api-test.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/api-test.pl b/tests/api-test.pl index 5cc433be..66b4c55c 100644 --- a/tests/api-test.pl +++ b/tests/api-test.pl @@ -11,6 +11,7 @@ sub request_json { $req->method($opts->{method} or "GET"); $req->uri("http://localhost:3000$opts->{uri}"); $req->header(Accept => "application/json"); + $req->header(Referer => "http://localhost:3000/") if $opts->{method} eq "POST"; $req->content(encode_json($opts->{data})) if defined $opts->{data}; my $res = $ua->request($req); print $res->as_string();