diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-12-28 14:08:48 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-28 14:08:48 -0800 |
commit | 9368a3d08ef0774081219f7b1d3705beeddaa200 (patch) | |
tree | f5754d249c1f4d4742b43e72422456b213c1f0d9 | |
parent | 8e777af273dd76c9140f6d8bf24a09e26a89f4c5 (diff) | |
parent | 77eac3f89a7b49424e7bb3498d20421878705485 (diff) | |
download | git-9368a3d08ef0774081219f7b1d3705beeddaa200.tar.gz git-9368a3d08ef0774081219f7b1d3705beeddaa200.tar.xz |
Merge branch 'nm/imap-send-quote-server-folder-name'
"git imap-send" did not correctly quote the folder name when
making a request to the server, which has been corrected.
* nm/imap-send-quote-server-folder-name:
imap-send: URI encode server folder
-rw-r--r-- | imap-send.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/imap-send.c b/imap-send.c index 54e6a80fd..36c7c1b4f 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1412,6 +1412,7 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred) { CURL *curl; struct strbuf path = STRBUF_INIT; + char *uri_encoded_folder; if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) die("curl_global_init failed"); @@ -1429,7 +1430,12 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred) strbuf_addstr(&path, server.host); if (!path.len || path.buf[path.len - 1] != '/') strbuf_addch(&path, '/'); - strbuf_addstr(&path, server.folder); + + uri_encoded_folder = curl_easy_escape(curl, server.folder, 0); + if (!uri_encoded_folder) + die("failed to encode server folder"); + strbuf_addstr(&path, uri_encoded_folder); + curl_free(uri_encoded_folder); curl_easy_setopt(curl, CURLOPT_URL, path.buf); strbuf_release(&path); |