]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
setopt: unset NOBODY switches to GET if still HEAD
authorDaniel Stenberg <daniel@haxx.se>
Mon, 27 Jul 2020 09:44:01 +0000 (11:44 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 27 Jul 2020 17:33:16 +0000 (19:33 +0200)
Unsetting CURLOPT_NOBODY with 0L when doing HTTP has no documented
action but before 7.71.0 that used to switch back to GET and with this
change (assuming the method is still set to HEAD) this behavior is
brought back.

Reported-by: causal-agent on github
Fixes #5725
Closes #5728

lib/setopt.c

index 90edf6aa7a0092963e0d6684194876b755a1446a..d6213357ccd4ff743823501356399801faafae85 100644 (file)
@@ -274,6 +274,8 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
     if(data->set.opt_no_body)
       /* in HTTP lingo, no body means using the HEAD request... */
       data->set.method = HTTPREQ_HEAD;
+    else if(data->set.method == HTTPREQ_HEAD)
+      data->set.method = HTTPREQ_GET;
     break;
   case CURLOPT_FAILONERROR:
     /*