Fix proxying header assertion failure.

Re-write Server of proxied requests to avoid:
    coolwsd: ./net/HttpRequest.hpp:945: bool http::Response::writeData(Buffer &) const:
    Assertion `get("Server") == http::getServerString() &&
    "Server Agent is always set in http::Response ctor"' failed.

Change-Id: I6076dbc355b0f42a6367271893c9732195c8eb2a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
This commit is contained in:
Michael Meeks 2024-06-28 15:41:49 +01:00
parent 17ae1f2ffe
commit f05cea2b13

View file

@ -65,6 +65,9 @@ void ProxyRequestHandler::handleRequest(const std::string& relPath,
CacheFileHash[httpSession->getUrl()] = httpResponse;
// We're proxying, we take responsibility.
httpResponse->set("Server", http::getServerString());
socket->sendAndShutdown(*httpResponse);
}
else