csun5285 commented on code in PR #52943:
URL: https://github.com/apache/doris/pull/52943#discussion_r2192131985
##########
be/src/http/http_client.cpp:
##########
@@ -600,19 +601,40 @@ Status HttpClient::_escape_url(const std::string& url,
std::string* escaped_url)
ampersand_pos = query.length();
}
+ auto encode_value_function = [&](const std::string& value, std::string&
result) {
+ size_t i = 0;
+ while (i < value.size()) {
+ // If skip_percent_encode is false %2E ---> %252E, we will encode
all '%' characters
+ // regardless of what follows them.
+ // If skip_percent_encode is true %2E ---> %2E, we will only
encode '%' characters
+ // that are not followed by two valid hexadecimal digits.
+ if (skip_percent_encode && value[i] == '%' && i + 2 <
value.size()) {
+ if (isxdigit(value[i + 1]) && isxdigit(value[i + 2])) {
+ result += value.substr(i, 3);
+ i += 3;
+ continue;
+ }
+ }
+ char* encoded = curl_easy_escape(_curl, &value[i], 1);
+ if (encoded) {
+ result += encoded;
+ curl_free(encoded);
+ } else {
Review Comment:
`curl_free(encoded);`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]