chromium/third_party/blink/web_tests/http/tests/xmlhttprequest/resources/cross-site-progress-events.cgi

#!/usr/bin/perl -wT

print "Content-type: text/plain\n"; 

if ($ENV{'REQUEST_METHOD'} eq "POST") {
    if ($ENV{'QUERY_STRING'} eq "allow") {
        print "Access-Control-Allow-Origin: *\n";
    }
    print "\n";
    if ($ENV{'CONTENT_LENGTH'}) {
        read(STDIN, $request, $ENV{'CONTENT_LENGTH'}) || die "Could not get query\n";
    } else {
        $request = "";
    }
    print $request;
} else {
    print "\n";
    print "Wrong method: " . $ENV{'REQUEST_METHOD'} . "\n";
}