Remove String clipping constructors.

Callers should instead call constructors with explicit encoding names, with known length `Span`.
This commit is contained in:
Lukas Tenbrink
2025-03-14 16:54:44 +01:00
parent b377562b52
commit a23f630781
12 changed files with 24 additions and 41 deletions

View File

@ -151,7 +151,7 @@ Error WSLPeer::accept_stream(Ref<StreamPeer> p_stream) {
}
bool WSLPeer::_parse_client_request() {
Vector<String> psa = String((const char *)handshake_buffer->get_data_array().ptr(), handshake_buffer->get_position() - 4).split("\r\n");
Vector<String> psa = String::ascii(Span((const char *)handshake_buffer->get_data_array().ptr(), handshake_buffer->get_position() - 4)).split("\r\n");
int len = psa.size();
ERR_FAIL_COND_V_MSG(len < 4, false, "Not enough response headers, got: " + itos(len) + ", expected >= 4.");
@ -416,7 +416,7 @@ void WSLPeer::_do_client_handshake() {
}
bool WSLPeer::_verify_server_response() {
Vector<String> psa = String((const char *)handshake_buffer->get_data_array().ptr(), handshake_buffer->get_position() - 4).split("\r\n");
Vector<String> psa = String::ascii(Span((const char *)handshake_buffer->get_data_array().ptr(), handshake_buffer->get_position() - 4)).split("\r\n");
int len = psa.size();
ERR_FAIL_COND_V_MSG(len < 4, false, "Not enough response headers. Got: " + itos(len) + ", expected >= 4.");