diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2019-11-15 18:01:02 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-11-15 18:01:02 +0000 |
commit | 98617e40e2bc9ec5c0c1b5637099d74c5aab4515 (patch) | |
tree | dc5403fa306c6fd4404b6feef78eba21a89a0ce0 /wsd/FileServer.cpp | |
parent | Rename misleading ClipboardContainer -> TextInput (diff) | |
download | online-98617e40e2bc9ec5c0c1b5637099d74c5aab4515.tar.gz online-98617e40e2bc9ec5c0c1b5637099d74c5aab4515.zip |
Enable protocol debugging by default in debug mode.
Also add a config option for logging.protocol - to help catch early
protocol issues during startup.
Change-Id: I6f0cc6dcf14b2797bc6b2bd36c44750d74eb0608
Diffstat (limited to 'wsd/FileServer.cpp')
-rw-r--r-- | wsd/FileServer.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp index 32373f3b07..5f49450c1d 100644 --- a/wsd/FileServer.cpp +++ b/wsd/FileServer.cpp @@ -633,6 +633,8 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco:: } } + const auto& config = Application::instance().config(); + Poco::replaceInPlace(preprocess, std::string("%ACCESS_TOKEN%"), escapedAccessToken); Poco::replaceInPlace(preprocess, std::string("%ACCESS_TOKEN_TTL%"), std::to_string(tokenTtl)); Poco::replaceInPlace(preprocess, std::string("%ACCESS_HEADER%"), escapedAccessHeader); @@ -640,13 +642,17 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco:: Poco::replaceInPlace(preprocess, std::string("%VERSION%"), std::string(LOOLWSD_VERSION_HASH)); Poco::replaceInPlace(preprocess, std::string("%SERVICE_ROOT%"), LOOLWSD::ServiceRoot); + std::string protocolDebug = "false"; + if (config.getBool("logging.protocol")) + protocolDebug = "true"; + Poco::replaceInPlace(preprocess, std::string("%PROTOCOL_DEBUG%"), protocolDebug); + static const std::string linkCSS("<link rel=\"stylesheet\" href=\"%s/loleaflet/" LOOLWSD_VERSION_HASH "/%s.css\">"); static const std::string scriptJS("<script src=\"%s/loleaflet/" LOOLWSD_VERSION_HASH "/%s.js\"></script>"); std::string brandCSS(Poco::format(linkCSS, LOOLWSD::ServiceRoot, std::string(BRANDING))); std::string brandJS(Poco::format(scriptJS, LOOLWSD::ServiceRoot, std::string(BRANDING))); - const auto& config = Application::instance().config(); #if ENABLE_SUPPORT_KEY const std::string keyString = config.getString("support_key", ""); SupportKey key(keyString); |