Allow env-var to affect serving from the FS only in debug mode.

Change-Id: I5e5d176295807af4de3e802ca02a0e1a1c17646e
This commit is contained in:
Michael Meeks 2017-05-08 09:51:06 +01:00
parent 3aec6e1227
commit 0088c14850

View file

@ -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);