Remove String clipping constructors.
Callers should instead call constructors with explicit encoding names, with known length `Span`.
This commit is contained in:
@ -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.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user