Use the new helper method in HTTPServerConnection::send().

This commit is contained in:
Relintai 2023-03-20 22:34:43 +01:00
parent 4b23c9c5c9
commit 5e17f2041d

View File

@ -172,10 +172,8 @@ void HTTPServerConnection::send_redirect(Ref<WebServerRequest> request, const St
void HTTPServerConnection::send(Ref<WebServerRequest> request) {
String body = request->get_compiled_body();
CharString body_cs = body.utf8();
String s = "HTTP/1.1 " + HTTPServerEnums::get_status_code_header_string(request->get_status_code()) + "\r\n";
s += "Content-Length: " + itos(body_cs.length()) + "\r\n";
s += "Content-Length: " + itos(body.utf8_byte_length()) + "\r\n";
s += "Content-type: text/html\r\n";
if (has_more_messages()) {