loolwsd: Fix convert-to regression; fix incorrect filepath formed

Regressed with 886af28bc2

Poco::URI::encode appends to given string, and encodedTo already
had content leading to incorrect path. Use a new std::string variable.

Change-Id: Ia72ff60ed9cf7f14ff649416a2ceeeda13ff6197
This commit is contained in:
Pranav Kant 2016-07-21 12:33:14 +05:30
parent 9417ec839c
commit 39645c974d

View file

@ -435,8 +435,9 @@ private:
if (!resultURL.getPath().empty())
{
const std::string mimeType = "application/octet-stream";
URI::encode(resultURL.getPath(), "", encodedTo);
response.sendFile(encodedTo, mimeType);
std::string encodedFilePath;
URI::encode(resultURL.getPath(), "", encodedFilePath);
response.sendFile(encodedFilePath, mimeType);
sent = true;
}