diff options
Diffstat (limited to 'lib/http.c')
-rw-r--r-- | lib/http.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/http.c b/lib/http.c index f08a343e3..c00d24fb8 100644 --- a/lib/http.c +++ b/lib/http.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -2028,8 +2028,10 @@ void Curl_http_method(struct Curl_easy *data, struct connectdata *conn, data->set.upload) httpreq = HTTPREQ_PUT; - /* Now set the 'request' pointer to the proper request string */ - if(data->set.str[STRING_CUSTOMREQUEST]) + /* Now set the 'request' pointer to the proper request string if + it isn't a redirect with redirect_clears_method set */ + if(data->set.str[STRING_CUSTOMREQUEST] && + (!data->state.this_is_a_follow || !data->set.redirect_clears_method)) request = data->set.str[STRING_CUSTOMREQUEST]; else { if(data->set.opt_no_body) |