1#!/usr/bin/perl 2 3use strict; 4use warnings; 5 6use HTTPTest; 7 8 9############################################################################### 10 11my $dummyfile = <<EOF; 12Don't care. 13EOF 14 15# code, msg, headers, content 16my %urls = ( 17 '/dummy.txt' => { 18 code => "200", 19 msg => "Dontcare", 20 headers => { 21 "Content-type" => "text/plain", 22 "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT", 23 "Content-Disposition" => "attachment; filename=\"filename.txt\"", 24 }, 25 content => $dummyfile 26 }, 27); 28 29my $cmdline = $WgetTest::WGETPATH . " -N --content-disposition " 30 . "http://localhost:{{port}}/dummy.txt"; 31 32my $expected_error_code = 0; 33 34my %expected_downloaded_files = ( 35 'filename.txt' => { 36 content => $dummyfile, 37 timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT" 38 } 39); 40 41############################################################################### 42 43my $the_test = HTTPTest->new (name => "Test-N-HTTP-Content-Disposition", 44 input => \%urls, 45 cmdline => $cmdline, 46 errcode => $expected_error_code, 47 output => \%expected_downloaded_files); 48exit $the_test->run(); 49 50# vim: et ts=4 sw=4 51 52