]> sjero.net Git - wget/blobdiff - src/main.c
Follow RFC 2616 and httpbis specifications when handling redirects
[wget] / src / main.c
index 2b42d2d7235eda6c1d7295b974423a6bb13c1084..c895c4eeb4e5de19dd13e4409dfc8d53245a9281 100644 (file)
@@ -1397,6 +1397,13 @@ for details.\n\n"));
         }
     }
 
+  /* Set various options as required for opt.method.  */
+
+  /* When user specifies HEAD as the method, we do not wish to download any
+     files. Hence, set wget to run in spider mode.  */
+  if (opt.method && strcasecmp (opt.method, "HEAD") == 0)
+    setoptval ("spider", "1", "spider");
+
   /* Convert post_data to body-data and post_file_name to body-file options.
      This is required so as to remove redundant code later on in gethttp().
      The --post-data and --post-file options may also be removed in