From cfcf3a01b9af3dc19cdaa2a8d6131d8ef37b4674 Mon Sep 17 00:00:00 2001 From: acetone Date: Tue, 4 Jan 2022 11:35:49 -0500 Subject: [PATCH] Long search request cant break page --- httpserver.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/httpserver.cpp b/httpserver.cpp index 3ebc0fc..5c43b3f 100644 --- a/httpserver.cpp +++ b/httpserver.cpp @@ -1024,7 +1024,14 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath, bool isHead } } } - middlePath += " " + searchRequest + " "; + int lastWbr = 0; + for (int i = 0; i < searchRequest.size(); i++) { + if (i-lastWbr > MAX_MESSAGE_LENGTH_WITHOUT_WBR) { + searchRequest.insert(i, ""); + lastWbr = i; + } + } + middlePath += " " + searchRequest + " "; if (rgxIsValid) middlePath += "rgx"; middlePath += "(" + QString::number(counter) + ")"; }