From feefbfcba0ddb9aebff25c568c040d7111c0981a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 10 Aug 2026 11:29:02 +0200 Subject: [PATCH] Apply Nemo's feedback --- Common/Net/HTTPHeaders.cpp | 9 ++++++++- Common/Net/WebsocketServer.cpp | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Common/Net/HTTPHeaders.cpp b/Common/Net/HTTPHeaders.cpp index fc4396574b..5ebc2e5781 100644 --- a/Common/Net/HTTPHeaders.cpp +++ b/Common/Net/HTTPHeaders.cpp @@ -75,8 +75,15 @@ int RequestHeader::ParseHttpHeader(const char *buffer) { const char *endptr = strchr(buffer, ' '); const char *q_ptr = strchr(buffer, '?'); if (!endptr) { - // No trailing space (e.g. a bare HTTP/0.9 "GET /" request). Fall back to + // No trailing space. Fall back to // the end of the line instead of leaving endptr null. + // Nemo's repro (python): + // import socket + // SERVER_IP = "127.0.0.1" + // PORT = 65199 # my port + // message = "GET /\n" + // client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + // client_socket.connect((SERVER_IP, PORT)); client_socket.sendall(message.encode('utf-8')) endptr = buffer + strlen(buffer); } diff --git a/Common/Net/WebsocketServer.cpp b/Common/Net/WebsocketServer.cpp index 069d225a35..c96f4c0532 100644 --- a/Common/Net/WebsocketServer.cpp +++ b/Common/Net/WebsocketServer.cpp @@ -17,7 +17,8 @@ static const char *const WEBSOCKET_GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" // Sanity cap on a single message's total size, so a client can't crash us by simply // claiming an enormous frame length before sending any actual data. -static constexpr uint64_t MAX_WS_MESSAGE_SIZE = 64 * 1024 * 1024; +// TODO: Make configurable? +static constexpr uint64_t MAX_WS_MESSAGE_SIZE = 128 * 1024 * 1024; namespace net {