wsd: fix assertion and better logging

In some cases the WOPISrc is inconsistently
encoded. So now we decode before comparing.

Also, improve related log entries.

Change-Id: Ifd6cca76c91a34761dd0ce8f6d78c3af5d47fd43
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
pull/8402/head
Ashod Nakashian 2024-02-26 17:34:35 -05:00 committed by Neil Guertin
parent e54c9aeab0
commit 2d31aafa11
2 changed files with 9 additions and 3 deletions

View File

@ -34,6 +34,7 @@
#include <ConfigUtil.hpp>
#include <JailUtil.hpp>
#include <ProofKey.hpp>
#include <Util.hpp>
#include <Poco/File.h>
#include <Poco/StreamCopier.h>
@ -564,8 +565,9 @@ void ClientRequestDispatcher::handleIncomingMessage(SocketDisposition& dispositi
accessDetails);
if (accessDetails.isValid())
{
LOG_ASSERT_MSG(requestDetails.getField(RequestDetails::Field::WOPISrc) ==
accessDetails.wopiSrc(),
LOG_ASSERT_MSG(Util::decodeURIComponent(
requestDetails.getField(RequestDetails::Field::WOPISrc)) ==
Util::decodeURIComponent(accessDetails.wopiSrc()),
"Expected identical WOPISrc in the request as in cool.html");
const std::string requestKey = RequestDetails::getRequestKey(

View File

@ -205,7 +205,7 @@ void RequestVettingStation::handleRequest(const std::string& id,
LOG_TRC_S('#' << moveSocket->getFD()
<< ": Dissociating client socket from "
"ClientRequestDispatcher and invoking CheckFileInfo for ["
<< docKey << ']');
<< docKey << "], " << name(_cfiState));
// CheckFileInfo and only when it's good create DocBroker.
if (_cfiState == CFIState::Active)
@ -368,6 +368,10 @@ void RequestVettingStation::checkFileInfo(const std::string& url, const Poco::UR
{
_cfiState = CFIState::Active;
}
else
{
LOG_ERR("Failed to start an async CheckFileInfo request");
}
}
#endif //!MOBILEAPP