Blame SOURCES/0030-curl-7.61.1-file-head.patch

1f2d5c
From 87e3d094e0dc00efc1abeb2b142d453024cbca69 Mon Sep 17 00:00:00 2001
1f2d5c
From: Daniel Stenberg <daniel@haxx.se>
1f2d5c
Date: Thu, 4 Oct 2018 23:53:32 +0200
1f2d5c
Subject: [PATCH] FILE: fix CURLOPT_NOBODY and CURLOPT_HEADER output
1f2d5c
1f2d5c
Now FILE transfers send headers to the header callback like HTTP and
1f2d5c
other protocols. Also made curl_easy_getinfo(...CURLINFO_PROTOCOL...)
1f2d5c
work for FILE in the callbacks.
1f2d5c
1f2d5c
Makes "curl -i file://.." and "curl -I file://.." work like before
1f2d5c
again. Applied the bold header logic to them too.
1f2d5c
1f2d5c
Regression from c1c2762 (7.61.0)
1f2d5c
1f2d5c
Reported-by: Shaun Jackman
1f2d5c
Fixes #3083
1f2d5c
Closes #3101
1f2d5c
1f2d5c
Upstream-commit: e50a2002bd450a4800a165d2874ed79c95b33a07
1f2d5c
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
1f2d5c
---
1f2d5c
 lib/file.c          | 27 +++++++++++++--------------
1f2d5c
 lib/getinfo.c       |  1 -
1f2d5c
 lib/url.c           |  1 +
1f2d5c
 src/tool_cb_hdr.c   |  5 +++--
1f2d5c
 tests/data/test1016 |  2 +-
1f2d5c
 tests/data/test1017 |  2 +-
1f2d5c
 tests/data/test1018 |  2 +-
1f2d5c
 tests/data/test1019 |  2 +-
1f2d5c
 tests/data/test1020 |  2 +-
1f2d5c
 tests/data/test1029 |  2 +-
1f2d5c
 tests/data/test1146 |  2 +-
1f2d5c
 tests/data/test1220 |  2 +-
1f2d5c
 tests/data/test200  |  2 +-
1f2d5c
 tests/data/test2000 |  2 +-
1f2d5c
 tests/data/test2001 | 13 +------------
1f2d5c
 tests/data/test2002 | 13 +------------
1f2d5c
 tests/data/test2003 | 26 ++------------------------
1f2d5c
 tests/data/test2004 |  2 +-
1f2d5c
 tests/data/test2006 |  8 ++++++++
1f2d5c
 tests/data/test2007 |  8 ++++++++
1f2d5c
 tests/data/test2008 |  8 ++++++++
1f2d5c
 tests/data/test2009 |  8 ++++++++
1f2d5c
 tests/data/test2010 |  8 ++++++++
1f2d5c
 tests/data/test202  |  2 +-
1f2d5c
 tests/data/test203  |  2 +-
1f2d5c
 tests/data/test204  |  2 +-
1f2d5c
 tests/data/test205  |  2 +-
1f2d5c
 tests/data/test2070 |  2 +-
1f2d5c
 tests/data/test2071 |  2 +-
1f2d5c
 tests/data/test2072 |  2 +-
1f2d5c
 tests/data/test210  |  2 +-
1f2d5c
 tests/data/test231  |  2 +-
1f2d5c
 tests/data/test288  |  2 +-
1f2d5c
 33 files changed, 82 insertions(+), 86 deletions(-)
1f2d5c
1f2d5c
diff --git a/lib/file.c b/lib/file.c
1f2d5c
index e50e988..f780658 100644
1f2d5c
--- a/lib/file.c
1f2d5c
+++ b/lib/file.c
1f2d5c
@@ -386,7 +386,6 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
1f2d5c
 
1f2d5c
   *done = TRUE; /* unconditionally */
1f2d5c
 
1f2d5c
-  Curl_initinfo(data);
1f2d5c
   Curl_pgrsStartNow(data);
1f2d5c
 
1f2d5c
   if(data->set.upload)
1f2d5c
@@ -413,21 +412,18 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
1f2d5c
     }
1f2d5c
   }
1f2d5c
 
1f2d5c
-  /* If we have selected NOBODY and HEADER, it means that we only want file
1f2d5c
-     information. Which for FILE can't be much more than the file size and
1f2d5c
-     date. */
1f2d5c
-  if(data->set.opt_no_body && data->set.include_header && fstated) {
1f2d5c
+  if(fstated) {
1f2d5c
     time_t filetime;
1f2d5c
     struct tm buffer;
1f2d5c
     const struct tm *tm = &buffer;
1f2d5c
     char header[80];
1f2d5c
     snprintf(header, sizeof(header),
1f2d5c
              "Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", expected_size);
1f2d5c
-    result = Curl_client_write(conn, CLIENTWRITE_BOTH, header, 0);
1f2d5c
+    result = Curl_client_write(conn, CLIENTWRITE_HEADER, header, 0);
1f2d5c
     if(result)
1f2d5c
       return result;
1f2d5c
 
1f2d5c
-    result = Curl_client_write(conn, CLIENTWRITE_BOTH,
1f2d5c
+    result = Curl_client_write(conn, CLIENTWRITE_HEADER,
1f2d5c
                                (char *)"Accept-ranges: bytes\r\n", 0);
1f2d5c
     if(result)
1f2d5c
       return result;
1f2d5c
@@ -439,19 +435,22 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
1f2d5c
 
1f2d5c
     /* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
1f2d5c
     snprintf(header, sizeof(header),
1f2d5c
-             "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
1f2d5c
+             "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n%s",
1f2d5c
              Curl_wkday[tm->tm_wday?tm->tm_wday-1:6],
1f2d5c
              tm->tm_mday,
1f2d5c
              Curl_month[tm->tm_mon],
1f2d5c
              tm->tm_year + 1900,
1f2d5c
              tm->tm_hour,
1f2d5c
              tm->tm_min,
1f2d5c
-             tm->tm_sec);
1f2d5c
-    result = Curl_client_write(conn, CLIENTWRITE_BOTH, header, 0);
1f2d5c
-    if(!result)
1f2d5c
-      /* set the file size to make it available post transfer */
1f2d5c
-      Curl_pgrsSetDownloadSize(data, expected_size);
1f2d5c
-    return result;
1f2d5c
+             tm->tm_sec,
1f2d5c
+             data->set.opt_no_body ? "": "\r\n");
1f2d5c
+    result = Curl_client_write(conn, CLIENTWRITE_HEADER, header, 0);
1f2d5c
+    if(result)
1f2d5c
+      return result;
1f2d5c
+    /* set the file size to make it available post transfer */
1f2d5c
+    Curl_pgrsSetDownloadSize(data, expected_size);
1f2d5c
+    if(data->set.opt_no_body)
1f2d5c
+      return result;
1f2d5c
   }
1f2d5c
 
1f2d5c
   /* Check whether file range has been specified */
1f2d5c
diff --git a/lib/getinfo.c b/lib/getinfo.c
1f2d5c
index 14b4562..54c2c2f 100644
1f2d5c
--- a/lib/getinfo.c
1f2d5c
+++ b/lib/getinfo.c
1f2d5c
@@ -85,7 +85,6 @@ CURLcode Curl_initinfo(struct Curl_easy *data)
1f2d5c
 #ifdef USE_SSL
1f2d5c
   Curl_ssl_free_certinfo(data);
1f2d5c
 #endif
1f2d5c
-
1f2d5c
   return CURLE_OK;
1f2d5c
 }
1f2d5c
 
1f2d5c
diff --git a/lib/url.c b/lib/url.c
1f2d5c
index b18db25..bb9d107 100644
1f2d5c
--- a/lib/url.c
1f2d5c
+++ b/lib/url.c
1f2d5c
@@ -4290,6 +4290,7 @@ static CURLcode create_conn(struct Curl_easy *data,
1f2d5c
     /* this is supposed to be the connect function so we better at least check
1f2d5c
        that the file is present here! */
1f2d5c
     DEBUGASSERT(conn->handler->connect_it);
1f2d5c
+    Curl_persistconninfo(conn);
1f2d5c
     result = conn->handler->connect_it(conn, &done);
1f2d5c
 
1f2d5c
     /* Setup a "faked" transfer that'll do nothing */
1f2d5c
diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c
1f2d5c
index e91e8ac..4f21221 100644
1f2d5c
--- a/src/tool_cb_hdr.c
1f2d5c
+++ b/src/tool_cb_hdr.c
1f2d5c
@@ -153,8 +153,9 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
1f2d5c
   }
1f2d5c
 
1f2d5c
   if(hdrcbdata->config->show_headers &&
1f2d5c
-     (protocol & (CURLPROTO_HTTP|CURLPROTO_HTTPS|CURLPROTO_RTSP))) {
1f2d5c
-    /* bold headers only happen for HTTP(S) and RTSP */
1f2d5c
+    (protocol &
1f2d5c
+     (CURLPROTO_HTTP|CURLPROTO_HTTPS|CURLPROTO_RTSP|CURLPROTO_FILE))) {
1f2d5c
+    /* bold headers only for selected protocols */
1f2d5c
     char *value = NULL;
1f2d5c
 
1f2d5c
     if(!outs->stream && !tool_create_output_file(outs))
1f2d5c
diff --git a/tests/data/test1016 b/tests/data/test1016
1f2d5c
index b404cac..4927f9e 100644
1f2d5c
--- a/tests/data/test1016
1f2d5c
+++ b/tests/data/test1016
1f2d5c
@@ -22,7 +22,7 @@ file
1f2d5c
  <name>
1f2d5c
 X-Y range on a file:// URL to stdout
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 -r 1-4 file://localhost/%PWD/log/test1016.txt 
1f2d5c
 </command>
1f2d5c
 <file name="log/test1016.txt">
1f2d5c
diff --git a/tests/data/test1017 b/tests/data/test1017
1f2d5c
index 6fbc38a..cfdd80f 100644
1f2d5c
--- a/tests/data/test1017
1f2d5c
+++ b/tests/data/test1017
1f2d5c
@@ -23,7 +23,7 @@ file
1f2d5c
  <name>
1f2d5c
 0-Y range on a file:// URL to stdout
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 -r 0-3 file://localhost/%PWD/log/test1017.txt 
1f2d5c
 </command>
1f2d5c
 <file name="log/test1017.txt">
1f2d5c
diff --git a/tests/data/test1018 b/tests/data/test1018
1f2d5c
index 28a7027..5748701 100644
1f2d5c
--- a/tests/data/test1018
1f2d5c
+++ b/tests/data/test1018
1f2d5c
@@ -22,7 +22,7 @@ file
1f2d5c
  <name>
1f2d5c
 X-X range on a file:// URL to stdout
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 -r 4-4 file://localhost/%PWD/log/test1018.txt 
1f2d5c
 </command>
1f2d5c
 <file name="log/test1018.txt">
1f2d5c
diff --git a/tests/data/test1019 b/tests/data/test1019
1f2d5c
index 4d9872a..054e38d 100644
1f2d5c
--- a/tests/data/test1019
1f2d5c
+++ b/tests/data/test1019
1f2d5c
@@ -23,7 +23,7 @@ file
1f2d5c
  <name>
1f2d5c
 X- range on a file:// URL to stdout
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 -r 7- file://localhost/%PWD/log/test1019.txt 
1f2d5c
 </command>
1f2d5c
 <file name="log/test1019.txt">
1f2d5c
diff --git a/tests/data/test1020 b/tests/data/test1020
1f2d5c
index 735871d..e924529 100644
1f2d5c
--- a/tests/data/test1020
1f2d5c
+++ b/tests/data/test1020
1f2d5c
@@ -23,7 +23,7 @@ file
1f2d5c
  <name>
1f2d5c
 -Y range on a file:// URL to stdout
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 -r -9 file://localhost/%PWD/log/test1020.txt 
1f2d5c
 </command>
1f2d5c
 <file name="log/test1020.txt">
1f2d5c
diff --git a/tests/data/test1029 b/tests/data/test1029
1f2d5c
index 2ffc7c6..c77209c 100644
1f2d5c
--- a/tests/data/test1029
1f2d5c
+++ b/tests/data/test1029
1f2d5c
@@ -29,7 +29,7 @@ http
1f2d5c
  <name>
1f2d5c
 HTTP Location: and 'redirect_url' check
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command>
1f2d5c
 http://%HOSTIP:%HTTPPORT/we/want/our/1029 -w '%{redirect_url}\n'
1f2d5c
 </command>
1f2d5c
 </client>
1f2d5c
diff --git a/tests/data/test1146 b/tests/data/test1146
1f2d5c
index 43f33b7..636748e 100644
1f2d5c
--- a/tests/data/test1146
1f2d5c
+++ b/tests/data/test1146
1f2d5c
@@ -24,7 +24,7 @@ file
1f2d5c
 <name>
1f2d5c
 --proto-default file
1f2d5c
 </name>
1f2d5c
-<command>
1f2d5c
+<command option="no-include">
1f2d5c
 --proto-default file %PWD/log/test1146.txt
1f2d5c
 </command>
1f2d5c
 <file name="log/test1146.txt">
1f2d5c
diff --git a/tests/data/test1220 b/tests/data/test1220
1f2d5c
index 959abbf..6752eb5 100644
1f2d5c
--- a/tests/data/test1220
1f2d5c
+++ b/tests/data/test1220
1f2d5c
@@ -20,7 +20,7 @@ file
1f2d5c
  <name>
1f2d5c
 file:// URLs with query string
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 file://localhost/%PWD/log/test1220.txt?a_query=foobar#afragment
1f2d5c
 </command>
1f2d5c
 <file name="log/test1220.txt">
1f2d5c
diff --git a/tests/data/test200 b/tests/data/test200
1f2d5c
index 8be1de0..c27f7c0 100644
1f2d5c
--- a/tests/data/test200
1f2d5c
+++ b/tests/data/test200
1f2d5c
@@ -23,7 +23,7 @@ file
1f2d5c
  <name>
1f2d5c
 basic file:// file
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 file://localhost/%PWD/log/test200.txt
1f2d5c
 </command>
1f2d5c
 <file name="log/test200.txt">
1f2d5c
diff --git a/tests/data/test2000 b/tests/data/test2000
1f2d5c
index d3edb16..db1ba13 100644
1f2d5c
--- a/tests/data/test2000
1f2d5c
+++ b/tests/data/test2000
1f2d5c
@@ -31,7 +31,7 @@ file
1f2d5c
  <name>
1f2d5c
 FTP RETR followed by FILE
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 ftp://%HOSTIP:%FTPPORT/2000 file://localhost/%PWD/log/test2000.txt
1f2d5c
 </command>
1f2d5c
 <file name="log/test2000.txt">
1f2d5c
diff --git a/tests/data/test2001 b/tests/data/test2001
1f2d5c
index 68c0df7..88a258e 100644
1f2d5c
--- a/tests/data/test2001
1f2d5c
+++ b/tests/data/test2001
1f2d5c
@@ -48,7 +48,7 @@ file
1f2d5c
  <name>
1f2d5c
 HTTP GET followed by FTP RETR followed by FILE
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 http://%HOSTIP:%HTTPPORT/20010001 ftp://%HOSTIP:%FTPPORT/20010002 file://localhost/%PWD/log/test2001.txt
1f2d5c
 </command>
1f2d5c
 <file name="log/test2001.txt">
1f2d5c
@@ -81,17 +81,6 @@ RETR 20010002
1f2d5c
 QUIT
1f2d5c
 </protocol>
1f2d5c
 <stdout>
1f2d5c
-HTTP/1.1 200 OK
1f2d5c
-Date: Thu, 09 Nov 2010 14:49:00 GMT
1f2d5c
-Server: test-server/fake
1f2d5c
-Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
1f2d5c
-ETag: "21025-dc7-39462498"
1f2d5c
-Accept-Ranges: bytes
1f2d5c
-Content-Length: 6
1f2d5c
-Connection: close
1f2d5c
-Content-Type: text/html
1f2d5c
-Funny-head: yesyes
1f2d5c
-
1f2d5c
 -foo-
1f2d5c
 data
1f2d5c
     to
1f2d5c
diff --git a/tests/data/test2002 b/tests/data/test2002
1f2d5c
index db96bfe..6dd2f93 100644
1f2d5c
--- a/tests/data/test2002
1f2d5c
+++ b/tests/data/test2002
1f2d5c
@@ -57,7 +57,7 @@ tftp
1f2d5c
  <name>
1f2d5c
 HTTP GET followed by FTP RETR followed by FILE followed by TFTP RRQ
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 http://%HOSTIP:%HTTPPORT/20020001 ftp://%HOSTIP:%FTPPORT/20020002 file://localhost/%PWD/log/test2002.txt tftp://%HOSTIP:%TFTPPORT//20020003
1f2d5c
 </command>
1f2d5c
 <file name="log/test2002.txt">
1f2d5c
@@ -96,17 +96,6 @@ filename: /20020003
1f2d5c
 QUIT
1f2d5c
 </protocol>
1f2d5c
 <stdout>
1f2d5c
-HTTP/1.1 200 OK
1f2d5c
-Date: Thu, 09 Nov 2010 14:49:00 GMT
1f2d5c
-Server: test-server/fake
1f2d5c
-Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
1f2d5c
-ETag: "21025-dc7-39462498"
1f2d5c
-Accept-Ranges: bytes
1f2d5c
-Content-Length: 6
1f2d5c
-Connection: close
1f2d5c
-Content-Type: text/html
1f2d5c
-Funny-head: yesyes
1f2d5c
-
1f2d5c
 -foo-
1f2d5c
 data
1f2d5c
     to
1f2d5c
diff --git a/tests/data/test2003 b/tests/data/test2003
1f2d5c
index 59a743f..09bee8e 100644
1f2d5c
--- a/tests/data/test2003
1f2d5c
+++ b/tests/data/test2003
1f2d5c
@@ -57,8 +57,8 @@ tftp
1f2d5c
  <name>
1f2d5c
 HTTP GET followed by FTP RETR followed by FILE followed by TFTP RRQ then again in reverse order
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
-http://%HOSTIP:%HTTPPORT/20030001 ftp://%HOSTIP:%FTPPORT/20030002 file://localhost/%PWD/log/test2003.txt tftp://%HOSTIP:%TFTPPORT//20030003 tftp://%HOSTIP:%TFTPPORT//20030003 file://localhost/%PWD/log/test2003.txt ftp://%HOSTIP:%FTPPORT/20030002 http://%HOSTIP:%HTTPPORT/20030001 
1f2d5c
+<command option="no-include">
1f2d5c
+http://%HOSTIP:%HTTPPORT/20030001 ftp://%HOSTIP:%FTPPORT/20030002 file://localhost/%PWD/log/test2003.txt tftp://%HOSTIP:%TFTPPORT//20030003 tftp://%HOSTIP:%TFTPPORT//20030003 file://localhost/%PWD/log/test2003.txt ftp://%HOSTIP:%FTPPORT/20030002 http://%HOSTIP:%HTTPPORT/20030001
1f2d5c
 </command>
1f2d5c
 <file name="log/test2003.txt">
1f2d5c
 foo
1f2d5c
@@ -109,17 +109,6 @@ Accept: */*
1f2d5c
 QUIT
1f2d5c
 </protocol>
1f2d5c
 <stdout>
1f2d5c
-HTTP/1.1 200 OK
1f2d5c
-Date: Thu, 09 Nov 2010 14:49:00 GMT
1f2d5c
-Server: test-server/fake
1f2d5c
-Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
1f2d5c
-ETag: "21025-dc7-39462498"
1f2d5c
-Accept-Ranges: bytes
1f2d5c
-Content-Length: 6
1f2d5c
-Connection: close
1f2d5c
-Content-Type: text/html
1f2d5c
-Funny-head: yesyes
1f2d5c
-
1f2d5c
 -foo-
1f2d5c
 data
1f2d5c
     to
1f2d5c
@@ -151,17 +140,6 @@ data
1f2d5c
 that FTP
1f2d5c
 works
1f2d5c
   so does it?
1f2d5c
-HTTP/1.1 200 OK
1f2d5c
-Date: Thu, 09 Nov 2010 14:49:00 GMT
1f2d5c
-Server: test-server/fake
1f2d5c
-Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
1f2d5c
-ETag: "21025-dc7-39462498"
1f2d5c
-Accept-Ranges: bytes
1f2d5c
-Content-Length: 6
1f2d5c
-Connection: close
1f2d5c
-Content-Type: text/html
1f2d5c
-Funny-head: yesyes
1f2d5c
-
1f2d5c
 -foo-
1f2d5c
 </stdout>
1f2d5c
 </verify>
1f2d5c
diff --git a/tests/data/test2004 b/tests/data/test2004
1f2d5c
index 4773f69..b17890b 100644
1f2d5c
--- a/tests/data/test2004
1f2d5c
+++ b/tests/data/test2004
1f2d5c
@@ -29,7 +29,7 @@ sftp
1f2d5c
  <name>
1f2d5c
 TFTP RRQ followed by SFTP retrieval followed by FILE followed by SCP retrieval then again in reverse order
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 --key curl_client_key --pubkey curl_client_key.pub -u %USER: tftp://%HOSTIP:%TFTPPORT//2004 sftp://%HOSTIP:%SSHPORT%POSIX_PWD/log/test2004.txt file://localhost/%PWD/log/test2004.txt scp://%HOSTIP:%SSHPORT%POSIX_PWD/log/test2004.txt file://localhost/%PWD/log/test2004.txt sftp://%HOSTIP:%SSHPORT%POSIX_PWD/log/test2004.txt tftp://%HOSTIP:%TFTPPORT//2004 --insecure
1f2d5c
 </command>
1f2d5c
 <file name="log/test2004.txt">
1f2d5c
diff --git a/tests/data/test2006 b/tests/data/test2006
1f2d5c
index e25556f..3acbdae 100644
1f2d5c
--- a/tests/data/test2006
1f2d5c
+++ b/tests/data/test2006
1f2d5c
@@ -4,6 +4,7 @@
1f2d5c
 Metalink
1f2d5c
 HTTP
1f2d5c
 HTTP GET
1f2d5c
+FILE
1f2d5c
 </keywords>
1f2d5c
 </info>
1f2d5c
 
1f2d5c
@@ -85,6 +86,10 @@ Accept: */*
1f2d5c
 Some data delivered from an HTTP resource
1f2d5c
 </file1>
1f2d5c
 <file2 name="log/heads2006">
1f2d5c
+Content-Length: 496
1f2d5c
+Accept-ranges: bytes
1f2d5c
+
1f2d5c
+
1f2d5c
 HTTP/1.1 200 OK
1f2d5c
 Date: Thu, 21 Jun 2012 14:49:01 GMT
1f2d5c
 Server: test-server/fake
1f2d5c
@@ -105,6 +110,9 @@ Metalink: fetching (log/download2006) from (http://%HOSTIP:%HTTPPORT/2006) OK
1f2d5c
 Metalink: validating (log/download2006)...
1f2d5c
 Metalink: validating (log/download2006) [sha-256] OK
1f2d5c
 </file4>
1f2d5c
+<stripfile2>
1f2d5c
+s/Last-Modified:.*//
1f2d5c
+</stripfile2>
1f2d5c
 <stripfile4>
1f2d5c
 $_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i))
1f2d5c
 </stripfile4>
1f2d5c
diff --git a/tests/data/test2007 b/tests/data/test2007
1f2d5c
index cc4bd8c..b169c49 100644
1f2d5c
--- a/tests/data/test2007
1f2d5c
+++ b/tests/data/test2007
1f2d5c
@@ -5,6 +5,7 @@ Metalink
1f2d5c
 HTTP
1f2d5c
 HTTP GET
1f2d5c
 -J
1f2d5c
+FILE
1f2d5c
 </keywords>
1f2d5c
 </info>
1f2d5c
 
1f2d5c
@@ -85,7 +86,14 @@ Accept: */*
1f2d5c
 <file1 name="log/download2007">
1f2d5c
 Something delivered from an HTTP resource
1f2d5c
 </file1>
1f2d5c
+<stripfile2>
1f2d5c
+s/Last-Modified:.*//
1f2d5c
+</stripfile2>
1f2d5c
 <file2 name="log/heads2007">
1f2d5c
+Content-Length: 496
1f2d5c
+Accept-ranges: bytes
1f2d5c
+
1f2d5c
+
1f2d5c
 HTTP/1.1 200 OK
1f2d5c
 Date: Thu, 21 Jun 2012 14:50:02 GMT
1f2d5c
 Server: test-server/fake
1f2d5c
diff --git a/tests/data/test2008 b/tests/data/test2008
1f2d5c
index 5843792..012f221 100644
1f2d5c
--- a/tests/data/test2008
1f2d5c
+++ b/tests/data/test2008
1f2d5c
@@ -4,6 +4,7 @@
1f2d5c
 Metalink
1f2d5c
 HTTP
1f2d5c
 HTTP GET
1f2d5c
+FILE
1f2d5c
 </keywords>
1f2d5c
 </info>
1f2d5c
 
1f2d5c
@@ -77,7 +78,14 @@ Accept: */*
1f2d5c
 <file1 name="log/download2008">
1f2d5c
 Some stuff delivered from an HTTP resource
1f2d5c
 </file1>
1f2d5c
+<stripfile2>
1f2d5c
+s/Last-Modified:.*//
1f2d5c
+</stripfile2>
1f2d5c
 <file2 name="log/heads2008">
1f2d5c
+Content-Length: 496
1f2d5c
+Accept-ranges: bytes
1f2d5c
+
1f2d5c
+
1f2d5c
 HTTP/1.1 200 OK
1f2d5c
 Date: Thu, 21 Jun 2012 15:23:48 GMT
1f2d5c
 Server: test-server/fake
1f2d5c
diff --git a/tests/data/test2009 b/tests/data/test2009
1f2d5c
index 84482ce..b0e5c6c 100644
1f2d5c
--- a/tests/data/test2009
1f2d5c
+++ b/tests/data/test2009
1f2d5c
@@ -5,6 +5,7 @@ Metalink
1f2d5c
 HTTP
1f2d5c
 HTTP GET
1f2d5c
 -J
1f2d5c
+FILE
1f2d5c
 </keywords>
1f2d5c
 </info>
1f2d5c
 
1f2d5c
@@ -78,7 +79,14 @@ Accept: */*
1f2d5c
 <file1 name="log/download2009">
1f2d5c
 Some contents delivered from an HTTP resource
1f2d5c
 </file1>
1f2d5c
+<stripfile2>
1f2d5c
+s/Last-Modified:.*//
1f2d5c
+</stripfile2>
1f2d5c
 <file2 name="log/heads2009">
1f2d5c
+Content-Length: 496
1f2d5c
+Accept-ranges: bytes
1f2d5c
+
1f2d5c
+
1f2d5c
 HTTP/1.1 200 OK
1f2d5c
 Date: Thu, 21 Jun 2012 16:27:17 GMT
1f2d5c
 Server: test-server/fake
1f2d5c
diff --git a/tests/data/test2010 b/tests/data/test2010
1f2d5c
index 91a83f4..33bb309 100644
1f2d5c
--- a/tests/data/test2010
1f2d5c
+++ b/tests/data/test2010
1f2d5c
@@ -4,6 +4,7 @@
1f2d5c
 Metalink
1f2d5c
 HTTP
1f2d5c
 HTTP GET
1f2d5c
+FILE
1f2d5c
 </keywords>
1f2d5c
 </info>
1f2d5c
 
1f2d5c
@@ -77,7 +78,14 @@ Accept: */*
1f2d5c
 <file1 name="log/download2010">
1f2d5c
 Contents delivered from an HTTP resource
1f2d5c
 </file1>
1f2d5c
+<stripfile2>
1f2d5c
+s/Last-Modified:.*//
1f2d5c
+</stripfile2>
1f2d5c
 <file2 name="log/heads2010">
1f2d5c
+Content-Length: 496
1f2d5c
+Accept-ranges: bytes
1f2d5c
+
1f2d5c
+
1f2d5c
 HTTP/1.1 200 OK
1f2d5c
 Date: Thu, 21 Jun 2012 17:37:27 GMT
1f2d5c
 Server: test-server/fake
1f2d5c
diff --git a/tests/data/test202 b/tests/data/test202
1f2d5c
index f863ec5..0b324b1 100644
1f2d5c
--- a/tests/data/test202
1f2d5c
+++ b/tests/data/test202
1f2d5c
@@ -19,7 +19,7 @@ file
1f2d5c
  <name>
1f2d5c
 two file:// URLs to stdout
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 file://localhost/%PWD/log/test202.txt FILE://localhost/%PWD/log/test202.txt
1f2d5c
 </command>
1f2d5c
 <file name="log/test202.txt">
1f2d5c
diff --git a/tests/data/test203 b/tests/data/test203
1f2d5c
index 366cc2c..3938426 100644
1f2d5c
--- a/tests/data/test203
1f2d5c
+++ b/tests/data/test203
1f2d5c
@@ -24,7 +24,7 @@ file
1f2d5c
  <name>
1f2d5c
 file:/path URL with a single slash
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 file:%PWD/log/test203.txt
1f2d5c
 </command>
1f2d5c
 <file name="log/test203.txt">
1f2d5c
diff --git a/tests/data/test204 b/tests/data/test204
1f2d5c
index 9cc7b01..0ed9451 100644
1f2d5c
--- a/tests/data/test204
1f2d5c
+++ b/tests/data/test204
1f2d5c
@@ -15,7 +15,7 @@ file
1f2d5c
  <name>
1f2d5c
 "upload" with file://
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 file://localhost/%PWD/log/result204.txt -T log/upload204.txt
1f2d5c
 </command>
1f2d5c
 <file name="log/upload204.txt">
1f2d5c
diff --git a/tests/data/test205 b/tests/data/test205
1f2d5c
index 4af93f6..f83c531 100644
1f2d5c
--- a/tests/data/test205
1f2d5c
+++ b/tests/data/test205
1f2d5c
@@ -16,7 +16,7 @@ file
1f2d5c
  <name>
1f2d5c
 "upload" with file://
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 file://localhost/%PWD/log/nonexisting/result205.txt -T log/upload205.txt
1f2d5c
 </command>
1f2d5c
 <file name="log/upload205.txt">
1f2d5c
diff --git a/tests/data/test2070 b/tests/data/test2070
1f2d5c
index bc3898a..655cd8a 100644
1f2d5c
--- a/tests/data/test2070
1f2d5c
+++ b/tests/data/test2070
1f2d5c
@@ -23,7 +23,7 @@ file
1f2d5c
  <name>
1f2d5c
 basic file:// file with no authority
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 file:%PWD/log/test2070.txt
1f2d5c
 </command>
1f2d5c
 <file name="log/test2070.txt">
1f2d5c
diff --git a/tests/data/test2071 b/tests/data/test2071
1f2d5c
index 997dfff..eddfa4d 100644
1f2d5c
--- a/tests/data/test2071
1f2d5c
+++ b/tests/data/test2071
1f2d5c
@@ -23,7 +23,7 @@ file
1f2d5c
  <name>
1f2d5c
 basic file:// file with "127.0.0.1" hostname
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 file://127.0.0.1/%PWD/log/test2070.txt
1f2d5c
 </command>
1f2d5c
 <file name="log/test2070.txt">
1f2d5c
diff --git a/tests/data/test2072 b/tests/data/test2072
1f2d5c
index cd26f22..1bab158 100644
1f2d5c
--- a/tests/data/test2072
1f2d5c
+++ b/tests/data/test2072
1f2d5c
@@ -23,7 +23,7 @@ file
1f2d5c
 <name>
1f2d5c
 file:// with unix path resolution behavior for the case of extra slashes
1f2d5c
 </name>
1f2d5c
-<command>
1f2d5c
+<command option="no-include">
1f2d5c
 file:////%PWD/log/test2072.txt
1f2d5c
 </command>
1f2d5c
 <precheck>
1f2d5c
diff --git a/tests/data/test210 b/tests/data/test210
1f2d5c
index e904567..c6fb703 100644
1f2d5c
--- a/tests/data/test210
1f2d5c
+++ b/tests/data/test210
1f2d5c
@@ -22,7 +22,7 @@ ftp
1f2d5c
  <name>
1f2d5c
 Get two FTP files from the same remote dir: no second CWD
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 ftp://%HOSTIP:%FTPPORT/a/path/210 ftp://%HOSTIP:%FTPPORT/a/path/210
1f2d5c
 </command>
1f2d5c
 <stdout>
1f2d5c
diff --git a/tests/data/test231 b/tests/data/test231
1f2d5c
index 6994957..3d4bc77 100644
1f2d5c
--- a/tests/data/test231
1f2d5c
+++ b/tests/data/test231
1f2d5c
@@ -22,7 +22,7 @@ file
1f2d5c
  <name>
1f2d5c
 file:// with resume
1f2d5c
  </name>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 file://localhost/%PWD/log/test231.txt -C 10
1f2d5c
 </command>
1f2d5c
 <file name="log/test231.txt">
1f2d5c
diff --git a/tests/data/test288 b/tests/data/test288
1f2d5c
index ff4db6a..9f8f6e1 100644
1f2d5c
--- a/tests/data/test288
1f2d5c
+++ b/tests/data/test288
1f2d5c
@@ -30,7 +30,7 @@ file:// with (unsupported) proxy, authentication and range
1f2d5c
 <setenv>
1f2d5c
 all_proxy=http://fake:user@%HOSTIP:%HTTPPORT/
1f2d5c
 </setenv>
1f2d5c
- <command>
1f2d5c
+<command option="no-include">
1f2d5c
 file://localhost/%PWD/log/test288.txt
1f2d5c
 </command>
1f2d5c
 <file name="log/test288.txt">
1f2d5c
-- 
1f2d5c
2.30.2
1f2d5c