* spider.c (in_url_list_p): Removed the bool verbose argument
+2007-08-22 Mauro Tortonesi <mauro@ferrara.linux.it>
+
+ * http.c (http_loop): Fall back to GET if HEAD fails with a 500 or 501
+ error code.
+
+2007-08-21 Mauro Tortonesi <mauro@ferrara.linux.it>
+
+ * http.c (http_loop): Send preliminary HEAD request if -N is given and
+ the destination file exists already.
+
+2007-08-10 Mauro Tortonesi <mauro@ferrara.linux.it>
+
+ * http.c (http_loop): Fixed HTTP HEAD requests logic when --spider is
+ given.
+
2007-08-10 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* url.c (append_uri_pathel): Do not assume dest string to be
* test.h: tests made more verbose; now displays the name
of each test run.
+2007-07-10 Mauro Tortonesi <mauro@ferrara.linux.it>
+
+ * http.c (http_loop): Fixed the HTTP requests logic. Now it skips the
+ preliminary HEAD request if either -O or --no-content-disposition are
+ given, and neither --spider and -N are given.
+
2007-07-05 Micah Cowan <micah@cowan.name>
* cmpt.c, connect.c, connect.h, convert.c, convert.h:
Updated GPL reference to version 3 or later, removed FSF
address.
+2007-07-04 Mauro Tortonesi <mauro@ferrara.linux.it>
+
+ * http.c (http_loop): Skip HEAD request and start immediately with GET
+ if -O is given.
+
2007-02-02 Hrvoje Niksic <hniksic@xemacs.org>
* http.c (print_server_response): Escape non-printable characters
wgint local_size = 0; /* the size of the local file */
struct http_stat hstat; /* HTTP status */
struct_stat st;
+ bool send_head_first = true;
/* Assert that no value for *LOCAL_FILE was passed. */
assert (local_file == NULL || *local_file == NULL);
/* Reset the document type. */
*dt = 0;
+ /* Skip preliminary HEAD request if we're not in spider mode AND
+ * if -O was given or HTTP Content-Disposition support is disabled. */
+ if (!opt.spider
+ && (got_name || !opt.content_disposition))
+ send_head_first = false;
+
+ /* Send preliminary HEAD request if -N is given and we have an existing
+ * destination file. */
+ if (opt.timestamping
+ && !opt.content_disposition
+ && file_exists_p (url_file_name (u)))
+ send_head_first = true;
+
/* THE loop */
do
{
/* Default document type is empty. However, if spider mode is
on or time-stamping is employed, HEAD_ONLY commands is
encoded within *dt. */
- if (((opt.spider || opt.timestamping) && !got_head)
- || (opt.always_rest && !got_name))
+ if (send_head_first && !got_head)
*dt |= HEAD_ONLY;
else
*dt &= ~HEAD_ONLY;
/* Get the new location (with or without the redirection). */
if (hstat.newloc)
*newloc = xstrdup (hstat.newloc);
-
+
switch (err)
{
case HERR: case HEOF: case CONSOCKERR: case CONCLOSED:
/* All possibilities should have been exhausted. */
abort ();
}
-
+
if (!(*dt & RETROKF))
{
char *hurl = NULL;
hurl = url_string (u, URL_AUTH_HIDE_PASSWD);
logprintf (LOG_NONVERBOSE, "%s:\n", hurl);
}
+
+ /* Fall back to GET if HEAD fails with a 500 or 501 error code. */
+ if (*dt & HEAD_ONLY
+ && (hstat.statcode == 500 || hstat.statcode == 501))
+ {
+ got_head = true;
+ continue;
+ }
/* Maybe we should always keep track of broken links, not just in
* spider mode. */
- if (opt.spider)
+ else if (opt.spider)
{
/* #### Again: ugly ugly ugly! */
if (!hurl)
}
/* Did we get the time-stamp? */
- if (!got_head)
+ if (send_head_first && !got_head)
{
bool restart_loop = false;
restart_loop = true;
}
- if (opt.always_rest)
- {
- got_name = true;
- restart_loop = true;
- }
-
if (opt.spider)
{
if (opt.recursive)
}
}
+ if (send_head_first)
+ {
+ got_name = true;
+ restart_loop = true;
+ }
+
got_head = true; /* no more time-stamping */
*dt &= ~HEAD_ONLY;
count = 0; /* the retrieve count for HEAD is reset */
2007-08-21 Mauro Tortonesi <mauro@ferrara.linux.it>
- * WgetTest.pm.in: Added support for timestamping of pre-existing
- files.
+ * WgetTest.pm.in: Added support for timestamping of pre-existing
+ files.
- * Test-N-current.px: Fixed broken test logic.
+ * Test-N-current.px: Fixed broken test logic.
* Makefile.in: Updated list of automatically run tests.
- * Test-HTTP-Content-Disposition.px: Added -e contentdisposition=on
- option, since now HTTP Content-Disposition header support is turned
- off by default.
+ * Test-HTTP-Content-Disposition.px: Added -e contentdisposition=on
+ option, since now HTTP Content-Disposition header support is turned
+ off by default.
- * Test-HTTP-Content-Disposition-1.px: Ditto.
+ * Test-HTTP-Content-Disposition-1.px: Ditto.
+
+2007-08-10 Mauro Tortonesi <mauro@ferrara.linux.it>
+
+ * Test--spider--no-content-disposition-trivial.px: Added new tests for
+ validation of HTTP Content-Disposition header support logic. In
+ particular, these tests check wget's behavior for every combination of
+ --spider [-r] and -e contentdisposition=on/off options.
+
+ * Test--spider-r-HTTP-Content-Disposition.px: Ditto.
+
+ * Test--spider-HTTP-Content-Disposition.px: Ditto.
+
+ * Test--spider--no-content-disposition.px: Ditto.
+
+ * Test--spider-r--no-content-disposition-trivial.px: Ditto.
+
+ * Test--spider-r--no-content-disposition.px: Ditto.
2007-07-25 Micah Cowan <micah@cowan.name>
ensure that correct basic creds are sent, but never until a
challenge has been sent.
+2007-07-10 Mauro Tortonesi <mauro@ferrara.linux.it>
+
+ * Test--no-content-disposition.px: Added new tests for validation of
+ HTTP Content-Disposition header support logic. In particular, these
+ tests check wget's behavior for every combination of -N/-O and -e
+ contentdisposition=on/off options.
+
+ * Test--no-content-disposition-trivial.px: Ditto.
+
+ * Test-N-HTTP-Content-Disposition.px: Ditto.
+
+ * Test-N--no-content-disposition.px: Ditto.
+
+ * Test-N--no-content-disposition-trivial.px: Ditto.
+
+ * Test-O-HTTP-Content-Disposition.px: Ditto.
+
+ * Test-O--no-content-disposition.px: Ditto.
+
+ * Test-O--no-content-disposition-trivial.px: Ditto.
+
2007-07-05 Micah Cowan <micah@cowan.name>
* Makefile.in:
./Test-HTTP-Content-Disposition-1.px && echo && echo
./Test-HTTP-Content-Disposition-2.px && echo && echo
./Test-HTTP-Content-Disposition.px && echo && echo
+ ./Test-N-current-HTTP-CD.px && echo && echo
./Test-N-current.px && echo && echo
+ ./Test-N-HTTP-Content-Disposition.px && echo && echo
+ ./Test-N--no-content-disposition.px && echo && echo
+ ./Test-N--no-content-disposition-trivial.px && echo && echo
+ ./Test--no-content-disposition.px && echo && echo
+ ./Test--no-content-disposition-trivial.px && echo && echo
./Test-N-old.px && echo && echo
./Test-nonexisting-quiet.px && echo && echo
./Test-noop.px && echo && echo
./Test-np.px && echo && echo
./Test-N.px && echo && echo
+ ./Test-O-HTTP-Content-Disposition.px && echo && echo
+ ./Test-O--no-content-disposition.px && echo && echo
+ ./Test-O--no-content-disposition-trivial.px && echo && echo
./Test-O-nonexisting.px && echo && echo
./Test-O.px && echo && echo
./Test-Restrict-Lowercase.px && echo && echo
./Test-Restrict-Uppercase.px && echo && echo
./Test--spider-fail.px && echo && echo
+ ./Test--spider-HTTP-Content-Disposition.px && echo && echo
+ ./Test--spider--no-content-disposition.px && echo && echo
+ ./Test--spider--no-content-disposition-trivial.px && echo && echo
./Test--spider.px && echo && echo
+ ./Test--spider-r-HTTP-Content-Disposition.px && echo && echo
+ ./Test--spider-r--no-content-disposition.px && echo && echo
+ ./Test--spider-r--no-content-disposition-trivial.px && echo && echo
./Test--spider-r.px && echo && echo
WgetTest.pm: WgetTest.pm.in @top_srcdir@/config.status
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $dummyfile = <<EOF;
+<html>
+<head>
+ <title>Page Title</title>
+</head>
+<body>
+ <p>
+ Some text.
+ </p>
+</body>
+</html>
+EOF
+
+# code, msg, headers, content
+my %urls = (
+ '/dummy.html' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/html",
+ },
+ content => $dummyfile,
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " --no-content-disposition http://localhost:8080/dummy.html";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+ 'dummy.html' => {
+ content => $dummyfile,
+ }
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test--no-content-disposition-trivial",
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
+ output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $dummyfile = <<EOF;
+<html>
+<head>
+ <title>Page Title</title>
+</head>
+<body>
+ <p>
+ Some text.
+ </p>
+</body>
+</html>
+EOF
+
+# code, msg, headers, content
+my %urls = (
+ '/dummy.html' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/html",
+ "Content-Disposition" => "attachment; filename=\"filename.html\"",
+ },
+ content => $dummyfile,
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " --no-content-disposition http://localhost:8080/dummy.html";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+ 'dummy.html' => {
+ content => $dummyfile,
+ }
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test--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
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $mainpage = <<EOF;
+<html>
+<head>
+ <title>Main Page</title>
+</head>
+<body>
+ <p>
+ Some text.
+ </p>
+</body>
+</html>
+EOF
+
+# code, msg, headers, content
+my %urls = (
+ '/index.html' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/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-trivial",
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
+ output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $mainpage = <<EOF;
+<html>
+<head>
+ <title>Main Page</title>
+</head>
+<body>
+ <p>
+ Some text.
+ </p>
+</body>
+</html>
+EOF
+
+# code, msg, headers, content
+my %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
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $mainpage = <<EOF;
+<html>
+<head>
+ <title>Main Page</title>
+</head>
+<body>
+ <p>
+ Some text.
+ </p>
+</body>
+</html>
+EOF
+
+# code, msg, headers, content
+my %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 http://localhost:8080/index.html";
+
+my $expected_error_code = 256;
+
+my %expected_downloaded_files = (
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test--spider-HTTP-Content-Disposition",
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
+ output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $mainpage = <<EOF;
+<html>
+<head>
+ <title>Main Page</title>
+</head>
+<body>
+ <p>
+ Some text and a link to a <a href="http://localhost:8080/secondpage.html">second page</a>.
+ Also, a <a href="http://localhost:8080/nonexistent">broken link</a>.
+ </p>
+</body>
+</html>
+EOF
+
+my $secondpage = <<EOF;
+<html>
+<head>
+ <title>Second Page</title>
+</head>
+<body>
+ <p>
+ Some text and a link to a <a href="http://localhost:8080/thirdpage.html">third page</a>.
+ Also, a <a href="http://localhost:8080/nonexistent">broken link</a>.
+ </p>
+</body>
+</html>
+EOF
+
+my $thirdpage = <<EOF;
+<html>
+<head>
+ <title>Third Page</title>
+</head>
+<body>
+ <p>
+ Some text and a link to a <a href="http://localhost:8080/dummy.txt">text file</a>.
+ Also, another <a href="http://localhost:8080/againnonexistent">broken link</a>.
+ </p>
+</body>
+</html>
+EOF
+
+my $dummyfile = <<EOF;
+Don't care.
+EOF
+
+# code, msg, headers, content
+my %urls = (
+ '/index.html' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/html",
+ },
+ content => $mainpage,
+ },
+ '/secondpage.html' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/html",
+ },
+ content => $secondpage,
+ },
+ '/thirdpage.html' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/html",
+ },
+ content => $thirdpage,
+ },
+ '/dummy.txt' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/plain",
+ },
+ content => $dummyfile
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " --spider -r --no-content-disposition http://localhost:8080/";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test--spider-r--no-content-disposition-trivial",
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
+ output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $mainpage = <<EOF;
+<html>
+<head>
+ <title>Main Page</title>
+</head>
+<body>
+ <p>
+ Some text and a link to a <a href="http://localhost:8080/secondpage.html">second page</a>.
+ Also, a <a href="http://localhost:8080/nonexistent">broken link</a>.
+ </p>
+</body>
+</html>
+EOF
+
+my $secondpage = <<EOF;
+<html>
+<head>
+ <title>Second Page</title>
+</head>
+<body>
+ <p>
+ Some text and a link to a <a href="http://localhost:8080/thirdpage.html">third page</a>.
+ Also, a <a href="http://localhost:8080/nonexistent">broken link</a>.
+ </p>
+</body>
+</html>
+EOF
+
+my $thirdpage = <<EOF;
+<html>
+<head>
+ <title>Third Page</title>
+</head>
+<body>
+ <p>
+ Some text and a link to a <a href="http://localhost:8080/dummy.txt">text file</a>.
+ Also, another <a href="http://localhost:8080/againnonexistent">broken link</a>.
+ </p>
+</body>
+</html>
+EOF
+
+my $dummyfile = <<EOF;
+Don't care.
+EOF
+
+# code, msg, headers, content
+my %urls = (
+ '/index.html' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/html",
+ },
+ content => $mainpage,
+ },
+ '/secondpage.html' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/html",
+ "Content-Disposition" => "attachment; filename=\"filename.html\"",
+ },
+ content => $secondpage,
+ },
+ '/thirdpage.html' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/html",
+ },
+ content => $thirdpage,
+ },
+ '/dummy.txt' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/plain",
+ },
+ content => $dummyfile
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " --spider -r --no-content-disposition http://localhost:8080/";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test--spider-r--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
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $mainpage = <<EOF;
+<html>
+<head>
+ <title>Main Page</title>
+</head>
+<body>
+ <p>
+ Some text and a link to a <a href="http://localhost:8080/secondpage.html">second page</a>.
+ Also, a <a href="http://localhost:8080/nonexistent">broken link</a>.
+ </p>
+</body>
+</html>
+EOF
+
+my $secondpage = <<EOF;
+<html>
+<head>
+ <title>Second Page</title>
+</head>
+<body>
+ <p>
+ Some text and a link to a <a href="http://localhost:8080/thirdpage.html">third page</a>.
+ Also, a <a href="http://localhost:8080/nonexistent">broken link</a>.
+ </p>
+</body>
+</html>
+EOF
+
+my $thirdpage = <<EOF;
+<html>
+<head>
+ <title>Third Page</title>
+</head>
+<body>
+ <p>
+ Some text and a link to a <a href="http://localhost:8080/dummy.txt">text file</a>.
+ Also, another <a href="http://localhost:8080/againnonexistent">broken link</a>.
+ </p>
+</body>
+</html>
+EOF
+
+my $dummyfile = <<EOF;
+Don't care.
+EOF
+
+# code, msg, headers, content
+my %urls = (
+ '/index.html' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/html",
+ },
+ content => $mainpage,
+ },
+ '/secondpage.html' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/html",
+ "Content-Disposition" => "attachment; filename=\"filename.html\"",
+ },
+ content => $secondpage,
+ },
+ '/thirdpage.html' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/html",
+ },
+ content => $thirdpage,
+ },
+ '/dummy.txt' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/plain",
+ },
+ content => $dummyfile
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " --spider -r http://localhost:8080/";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test--spider-r-HTTP-Content-Disposition",
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
+ output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $dummyfile = <<EOF;
+Content
+EOF
+
+# code, msg, headers, content
+my %urls = (
+ '/dummy.txt' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/plain",
+ "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT",
+ },
+ content => $dummyfile
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " -N --no-content-disposition http://localhost:8080/dummy.txt";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+ 'dummy.txt' => {
+ content => $dummyfile,
+ timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT"
+ }
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-N--no-content-disposition-trivial",
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
+ output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $dummyfile = <<EOF;
+Content
+EOF
+
+# code, msg, headers, content
+my %urls = (
+ '/dummy.txt' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/plain",
+ "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT",
+ "Content-Disposition" => "attachment; filename=\"filename.txt\"",
+ },
+ content => $dummyfile
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " -N --no-content-disposition http://localhost:8080/dummy.txt";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+ 'dummy.txt' => {
+ content => $dummyfile,
+ timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT"
+ }
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-N--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
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $dummyfile = <<EOF;
+Don't care.
+EOF
+
+# code, msg, headers, content
+my %urls = (
+ '/dummy.txt' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/plain",
+ "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT",
+ "Content-Disposition" => "attachment; filename=\"filename.txt\"",
+ },
+ content => $dummyfile
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:8080/dummy.txt";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+ 'filename.txt' => {
+ content => $dummyfile,
+ timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT"
+ }
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-N-HTTP-Content-Disposition",
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
+ output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $dummyfile = <<EOF;
+Don't care.
+EOF
+
+# code, msg, headers, content
+my %urls = (
+ '/dummy.txt' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/plain",
+ },
+ content => $dummyfile
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " -O out --no-content-disposition http://localhost:8080/dummy.txt";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+ 'out' => {
+ content => $dummyfile,
+ }
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-O--no-content-disposition-trivial",
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
+ output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $dummyfile = <<EOF;
+Don't care.
+EOF
+
+# code, msg, headers, content
+my %urls = (
+ '/dummy.txt' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/plain",
+ "Content-Disposition" => "attachment; filename=\"filename.txt\"",
+ },
+ content => $dummyfile
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " -O out --no-content-disposition http://localhost:8080/dummy.txt";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+ 'out' => {
+ content => $dummyfile,
+ }
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-O--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
+
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $dummyfile = <<EOF;
+Don't care.
+EOF
+
+# code, msg, headers, content
+my %urls = (
+ '/dummy.txt' => {
+ code => "200",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/plain",
+ "Content-Disposition" => "attachment; filename=\"filename.txt\"",
+ },
+ content => $dummyfile
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " -O out http://localhost:8080/dummy.txt";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+ 'out' => {
+ content => $dummyfile,
+ }
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-O-HTTP-Content-Disposition",
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
+ output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+