From 04f81f8590cddcb0cc6833a890a59cd954fa4a25 Mon Sep 17 00:00:00 2001 From: Rash419 Date: Mon, 20 Jun 2022 15:50:32 +0530 Subject: [PATCH] wsd: fix: use only alias_groups entries when defined ignore wopi.storage.host entries when storage.wopi.alias_groups entry is defined in config Signed-off-by: Rash419 Change-Id: I7ea73f147e283077b02bdacb37f8850f7613c0c3 --- wsd/HostUtil.cpp | 2 ++ wsd/Storage.cpp | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/wsd/HostUtil.cpp b/wsd/HostUtil.cpp index f0486c7e0..b418558ad 100644 --- a/wsd/HostUtil.cpp +++ b/wsd/HostUtil.cpp @@ -59,6 +59,8 @@ bool HostUtil::allowedWopiHost(const std::string& host) void HostUtil::parseAliases(Poco::Util::LayeredConfiguration& conf) { + WopiEnabled = conf.getBool("storage.wopi[@allow]", false); + //set alias_groups mode to compat if (!conf.has("storage.wopi.alias_groups")) { diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp index 051dd1ca6..d92db8e0c 100644 --- a/wsd/Storage.cpp +++ b/wsd/Storage.cpp @@ -90,7 +90,11 @@ void StorageBase::initialize() const auto& app = Poco::Util::Application::instance(); FilesystemEnabled = app.config().getBool("storage.filesystem[@allow]", false); - HostUtil::parseWopiHost(app.config()); + //parse wopi.storage.host only when there is no storage.wopi.alias_groups entry in config + if (!app.config().has("storage.wopi.alias_groups")) + { + HostUtil::parseWopiHost(app.config()); + } #ifdef ENABLE_FEATURE_LOCK CommandControl::LockManager::parseLockedHost(app.config());