]> sjero.net Git - wget/blob - tests/Test-N--no-content-disposition.px
Fix build when libpsl is not available
[wget] / tests / Test-N--no-content-disposition.px
1 #!/usr/bin/env perl
2
3 use strict;
4 use warnings;
5
6 use HTTPTest;
7
8
9 ###############################################################################
10
11 my $dummyfile = <<EOF;
12 Content
13 EOF
14
15 # code, msg, headers, content
16 my %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
29 my $cmdline = $WgetTest::WGETPATH . " -N --no-content-disposition http://localhost:{{port}}/dummy.txt";
30
31 my $expected_error_code = 0;
32
33 my %expected_downloaded_files = (
34     'dummy.txt' => {
35         content => $dummyfile,
36         timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT"
37     }
38 );
39
40 ###############################################################################
41
42 my $the_test = HTTPTest->new (name => "Test-N--no-content-disposition",
43                               input => \%urls,
44                               cmdline => $cmdline,
45                               errcode => $expected_error_code,
46                               output => \%expected_downloaded_files);
47 exit $the_test->run();
48
49 # vim: et ts=4 sw=4
50