From 0088c148506a1a474ca64b9eb3facbebdb767757 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 8 May 2017 09:51:06 +0100 Subject: [PATCH] Allow env-var to affect serving from the FS only in debug mode. Change-Id: I5e5d176295807af4de3e802ca02a0e1a1c17646e --- wsd/FileServer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp index 3429ca104..ac4be4c6a 100644 --- a/wsd/FileServer.cpp +++ b/wsd/FileServer.cpp @@ -207,6 +207,7 @@ void FileServerRequestHandler::handleRequest(const HTTPRequest& request, Poco::M bool gzip = request.hasToken("Accept-Encoding", "gzip"); const std::string *content; +#ifdef ENABLE_DEBUG if (std::getenv("LOOL_SERVE_FROM_FS")) { // Useful to not serve from memory sometimes especially during loleaflet development @@ -215,7 +216,8 @@ void FileServerRequestHandler::handleRequest(const HTTPRequest& request, Poco::M HttpHelper::sendFile(socket, filePath, mimeType, response, noCache); return; } - else if (gzip) +#endif + if (gzip) { response.set("Content-Encoding", "gzip"); content = getCompressedFile(relPath);