test--spider--no-content-disposition.px

来自「一个从网络上自动下载文件的自由工具」· PX 代码 · 共 54 行

PX
54
字号
#!/usr/bin/perl -wuse strict;use HTTPTest;###############################################################################my $mainpage = <<EOF;<html><head>  <title>Main Page</title></head><body>  <p>    Some text.  </p></body></html>EOF# code, msg, headers, contentmy %urls = (    '/index.html' => {        code => "200",        msg => "Dontcare",        headers => {            "Content-type" => "text/html",            "Content-Disposition" => "attachment; filename=\"filename.html\"",        },        content => $mainpage,    },);my $cmdline = $WgetTest::WGETPATH . " --spider --no-content-disposition http://localhost:8080/index.html";my $expected_error_code = 256;my %expected_downloaded_files = ();###############################################################################my $the_test = HTTPTest->new (name => "Test--spider--no-content-disposition",                              input => \%urls,                               cmdline => $cmdline,                               errcode => $expected_error_code,                               output => \%expected_downloaded_files);exit $the_test->run();# vim: et ts=4 sw=4

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?