summaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c
index 9fbd7201e..dfe57ad45 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -2050,8 +2050,10 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
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)