LOOLSession: handle file:// in the ToPrisoner saveas input handler

This commit is contained in:
Miklos Vajna 2015-10-20 14:44:47 +02:00
parent dc56637e11
commit 847c65cb1c

View file

@ -192,9 +192,19 @@ bool MasterProcessSession::handleInput(const char *buffer, int length)
return true;
if (peer)
{
// Save as completed, inform the other (Kind::ToClient)
// MasterProcessSession about it.
const std::string filePrefix("file:///");
if (url.find(filePrefix) == 0)
{
// Rewrite file:// URLs, as they are visible to the outside world.
Path path(MasterProcessSession::getJailPath(_childId), url.substr(filePrefix.length()));
url = filePrefix + path.toString().substr(1);
}
peer->_saveAsQueue.put(url);
}
return true;
}