Skip to content

Commit

Permalink
Merge pull request #75867 from tefusion/fix_http_client_unicode_request
Browse files Browse the repository at this point in the history
Fix HTTPClient _request using wrong size
  • Loading branch information
Faless authored May 14, 2023
2 parents ffd32a2 + 1514376 commit fb10f45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/io/http_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ Error HTTPClient::_request_raw(Method p_method, const String &p_url, const Vecto
}

Error HTTPClient::_request(Method p_method, const String &p_url, const Vector<String> &p_headers, const String &p_body) {
int size = p_body.length();
return request(p_method, p_url, p_headers, size > 0 ? (const uint8_t *)p_body.utf8().get_data() : nullptr, size);
CharString body_utf8 = p_body.utf8();
int size = body_utf8.length();
return request(p_method, p_url, p_headers, size > 0 ? (const uint8_t *)body_utf8.get_data() : nullptr, size);
}

String HTTPClient::query_string_from_dict(const Dictionary &p_dict) {
Expand Down

0 comments on commit fb10f45

Please sign in to comment.