cool#9219 clipboard: only download clipboard-looking URLs
The net.service_root setting means we can't require that this is at the start, but at least we should not accept any random URLs there. Signed-off-by: Miklos Vajna <vmiklos@collabora.com> Change-Id: I2f492564066206d17d66d966e77e6abaf8104d1a
This commit is contained in:
parent
fa1a4771b1
commit
010bab3b77
1 changed files with 11 additions and 3 deletions
|
@ -350,10 +350,18 @@ void ClientSession::handleClipboardRequest(DocumentBroker::ClipboardRequest
|
|||
|
||||
std::shared_ptr<http::Session> httpSession = http::Session::create(url);
|
||||
httpSession->setFinishedHandler(std::move(finishedCallback));
|
||||
http::Request httpRequest(Poco::URI(url).getPathAndQuery());
|
||||
if (!httpSession->asyncRequest(httpRequest, docBroker->getPoll()))
|
||||
std::string pathAndQuery = Poco::URI(url).getPathAndQuery();
|
||||
if (pathAndQuery.find("/cool/clipboard") != std::string::npos)
|
||||
{
|
||||
LOG_ERR("Failed to start an async clipboard download request");
|
||||
http::Request httpRequest(Poco::URI(url).getPathAndQuery());
|
||||
if (!httpSession->asyncRequest(httpRequest, docBroker->getPoll()))
|
||||
{
|
||||
LOG_ERR("Failed to start an async clipboard download request");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERR("Clipboard download URL does not look like a clipboard one");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue