curl: error out if -T and -d are used for the same URL

As one implies PUT and the other POST, both cannot be used
simultaneously.

Add test 378 to verify.

Reported-by: Boris Verkhovskiy
Fixes #8704
Closes #8715
This commit is contained in:
Daniel Stenberg 2022-04-17 11:18:16 +02:00
parent 6968fb9d54
commit 01a1697a79
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 54 additions and 6 deletions

View file

@ -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
@ -85,7 +85,8 @@ int SetHTTPrequest(struct OperationConfig *config, HttpReq req, HttpReq *store)
"GET (-G, --get)",
"HEAD (-I, --head)",
"multipart formpost (-F, --form)",
"POST (-d, --data)"
"POST (-d, --data)",
"PUT (-T, --upload-file)"
};
if((*store == HTTPREQ_UNSPEC) ||
@ -109,7 +110,8 @@ void customrequest_helper(struct OperationConfig *config, HttpReq req,
"GET",
"HEAD",
"POST",
"POST"
"POST",
"PUT"
};
if(!method)