提交 b9be530c authored 作者: Nathan Neulinger's avatar Nathan Neulinger 提交者: Brian West

FS-8308 need to double encode if urlencoding json that is already encoded

上级 799bb493
...@@ -322,7 +322,7 @@ static switch_status_t my_on_reporting_cb(switch_core_session_t *session, cdr_pr ...@@ -322,7 +322,7 @@ static switch_status_t my_on_reporting_cb(switch_core_session_t *session, cdr_pr
memset(cdr_text_escaped, 0, need_bytes); memset(cdr_text_escaped, 0, need_bytes);
if (profile->encode == ENCODING_DEFAULT) { if (profile->encode == ENCODING_DEFAULT) {
headers = switch_curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded"); headers = switch_curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
switch_url_encode(cdr_text, cdr_text_escaped, need_bytes); switch_url_encode_opt(cdr_text, cdr_text_escaped, need_bytes, SWITCH_TRUE);
} else { } else {
headers = switch_curl_slist_append(headers, "Content-Type: application/x-www-form-base64-encoded"); headers = switch_curl_slist_append(headers, "Content-Type: application/x-www-form-base64-encoded");
switch_b64_encode((unsigned char *) cdr_text, need_bytes / 3, (unsigned char *) cdr_text_escaped, need_bytes); switch_b64_encode((unsigned char *) cdr_text, need_bytes / 3, (unsigned char *) cdr_text_escaped, need_bytes);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论