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