summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-07-27 11:44:01 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-07-27 11:44:01 +0200
commit9a251cc66ac8c416eaf4645bdc17de66c191e43c (patch)
treea8ba39bd57ffcf42e203d1aa88650b0980eeb6ac
parent0c6112a139c1133f7bdfc440903c0e5602c84d90 (diff)
downloadcurl-bagder/unset-nobody-get.tar.gz
setopt: unset NOBODY switches to GET if still HEADbagder/unset-nobody-get
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 Isssue: #5725
-rw-r--r--lib/setopt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/setopt.c b/lib/setopt.c
index 90edf6aa7..d6213357c 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -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:
/*