summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortefusion <makotoprogr4mming@gmail.com>2023-04-09 20:51:50 +0200
committertefusion <makotoprogr4mming@gmail.com>2023-04-10 11:45:41 +0200
commit1514376e465cfdb106262ccad2abcec42531608c (patch)
tree6fd7747a878ae215ee26d8fe5089ce5063a3ee40
parente684d126ed605899267ee37cc143f072b93b4d04 (diff)
downloadredot-engine-1514376e465cfdb106262ccad2abcec42531608c.tar.gz
Fix HTTPClient _request using wrong size
This only affects HttpClient in GDScript.
-rw-r--r--core/io/http_client.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 190edbfb82..09505ea05d 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -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) {