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