diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2017-12-15 15:32:44 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2017-12-15 15:35:18 +0100 |
commit | 206275f3e70187252c4b80ec0ba33f390e47f2ec (patch) | |
tree | 600bf6123715724174a74a6e627a065beaa0650a /platform/javascript | |
parent | 433cb6f490893a2d38cc46bbc7c7005cdb1281f8 (diff) |
Fix javascript build error and improve #14604
Diffstat (limited to 'platform/javascript')
-rw-r--r-- | platform/javascript/http_client_javascript.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/javascript/http_client_javascript.cpp b/platform/javascript/http_client_javascript.cpp index 9ce27c9a04..b170ba6f35 100644 --- a/platform/javascript/http_client_javascript.cpp +++ b/platform/javascript/http_client_javascript.cpp @@ -42,12 +42,12 @@ Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl, host = p_host; - String host_lower = conn_host.to_lower(); + String host_lower = host.to_lower(); if (host_lower.begins_with("http://")) { - host.replace_first("http://", ""); + host = host.substr(7, host.length() - 7); } else if (host_lower.begins_with("https://")) { use_tls = true; - host.replace_first("https://", ""); + host = host.substr(8, host.length() - 8); } ERR_FAIL_COND_V(host.length() < HOST_MIN_LEN, ERR_INVALID_PARAMETER); |