Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / navigation / resources / reloadresult.pl
blob400c0c5c630a213357aa40ef75b3b731943ba093
1 #!/usr/bin/perl
2 # Simple script to generate a POST result.
4 # Depending on which button was pushed in the form, we either generate a direct
5 # result page, or we use the pattern where the post returns a 303 redirect,
6 # and then the resulting GET yields the true POST result. Sites do this trick
7 # to avoid having POSTS in the b/f list, so you don't run into POSTs getting
8 # resubmitted by accident.
10 use CGI;
11 $query = new CGI;
12 $method = $query->request_method();
14 if ($method eq "POST") {
16 print "Content-type: text/html\r\n";
17 print "\r\n";
19 print <<HERE_DOC_END
20 <html>
21 Test failure: reloadresult.pl was called with an unexpected method ($method).
22 </body>
23 </html>
24 HERE_DOC_END
26 } elsif ($method eq "GET") {
28 print "Content-type: text/html\r\n";
29 print "\r\n";
31 print <<HERE_DOC_END
32 <html>
33 <body>
34 PASS
35 </body>
36 </html>
37 HERE_DOC_END