diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2021-08-31 08:36:58 -0400 |
---|---|---|
committer | Ashod Nakashian <Ashod@users.noreply.github.com> | 2021-09-13 09:40:09 -0400 |
commit | a7a204f16e676823923f0b88020a87c348dace4b (patch) | |
tree | d14dd12b753910fd2c53945440d02d419e2ea2b5 /wsd | |
parent | leaflet: makeWsUrl (diff) | |
download | online-a7a204f16e676823923f0b88020a87c348dace4b.tar.gz online-a7a204f16e676823923f0b88020a87c348dace4b.zip |
wsd: configuration setting to control embedded-url hexifying
Change-Id: I7ed65af7341aa7dec3c9ad8d5cd503c34c355571
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 8f4316b45b1aad7a041e8b02d92e5ef10d63b2b3)
Diffstat (limited to 'wsd')
-rw-r--r-- | wsd/FileServer.cpp | 5 | ||||
-rw-r--r-- | wsd/LOOLWSD.cpp | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp index cf0b343f5f..888081f323 100644 --- a/wsd/FileServer.cpp +++ b/wsd/FileServer.cpp @@ -714,7 +714,6 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco::replaceInPlace(preprocess, std::string("%ACCESS_TOKEN_TTL%"), std::to_string(tokenTtl)); Poco::replaceInPlace(preprocess, std::string("%ACCESS_HEADER%"), escapedAccessHeader); Poco::replaceInPlace(preprocess, std::string("%HOST%"), cnxDetails.getWebSocketUrl()); - Poco::replaceInPlace(preprocess, std::string("%HEXIFY_URL%"), std::string("false")); Poco::replaceInPlace(preprocess, std::string("%VERSION%"), std::string(LOOLWSD_VERSION_HASH)); Poco::replaceInPlace(preprocess, std::string("%SERVICE_ROOT%"), responseRoot); Poco::replaceInPlace(preprocess, std::string("%UI_DEFAULTS%"), uiDefaultsToJSON(uiDefaults, userInterfaceMode)); @@ -726,6 +725,10 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, protocolDebug = "true"; Poco::replaceInPlace(preprocess, std::string("%PROTOCOL_DEBUG%"), protocolDebug); + static const std::string hexifyEmbeddedUrls = + LOOLWSD::getConfigValue<bool>("hexify_embedded_urls", false) ? "true" : "false"; + Poco::replaceInPlace(preprocess, std::string("%HEXIFY_URL%"), hexifyEmbeddedUrls); + 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>"); diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index 27b09895e0..682e6bcbfb 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -1026,6 +1026,7 @@ void LOOLWSD::innerInitialize(Application& self) { "admin_console.enable_pam", "false" }, { "child_root_path", "jails" }, { "file_server_root_path", "loleaflet/.." }, + { "hexify_embedded_urls", "false" }, { "lo_jail_subpath", "lo" }, { "logging.protocol", "false" }, { "logging.anonymize.filenames", "false" }, // Deprecated. |