mirror of
https://github.com/curl/curl.git
synced 2026-08-25 07:03:31 +03:00
mime: use percent-escaping for multipart form field and file names
Until now, form field and file names where escaped using the backslash-escaping algorithm defined for multipart mails. This commit replaces this with the percent-escaping method for URLs. As this may introduce incompatibilities with server-side applications, a new libcurl option CURLOPT_MIME_OPTIONS with bitmask CURLMIMEOPT_FORMESCAPE is introduced to revert to legacy use of backslash-escaping. This is controlled by new cli tool option --form-escape. New tests and documentation are provided for this feature. Reported by: Ryan Sleevi Fixes #7789 Closes #7805
This commit is contained in:
parent
6ec28eb687
commit
b20b364764
23 changed files with 463 additions and 30 deletions
|
|
@ -2609,6 +2609,13 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
break;
|
||||
#endif
|
||||
|
||||
#if (!defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_MIME)) || \
|
||||
!defined(CURL_DISABLE_SMTP) || !defined(CURL_DISABLE_IMAP)
|
||||
case CURLOPT_MIME_OPTIONS:
|
||||
data->set.mime_options = va_arg(param, long);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case CURLOPT_SASL_AUTHZID:
|
||||
/* Authorisation identity (identity to act as) */
|
||||
result = Curl_setstropt(&data->set.str[STRING_SASL_AUTHZID],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue