loolwsd: Decode the encoded access_token before CheckFileInfo
Change-Id: Ia4511803ca5570ad5675e00c99108fd32360734d
This commit is contained in:
parent
8a1ac91fa6
commit
1618f6be4d
1 changed files with 15 additions and 0 deletions
|
@ -111,6 +111,21 @@ Poco::URI DocumentBroker::sanitizeURI(const std::string& uri)
|
|||
throw std::runtime_error("Invalid URI.");
|
||||
}
|
||||
|
||||
// We decoded access token before embedding it in loleaflet.html
|
||||
// So, we need to decode it now to get its actual value
|
||||
Poco::URI::QueryParameters queryParams = uriPublic.getQueryParameters();
|
||||
for (auto& param: queryParams)
|
||||
{
|
||||
// look for encoded query params (access token as of now)
|
||||
if (param.first == "access_token")
|
||||
{
|
||||
std::string decodedToken;
|
||||
Poco::URI::decode(param.second, decodedToken);
|
||||
param.second = decodedToken;
|
||||
}
|
||||
}
|
||||
uriPublic.setQueryParameters(queryParams);
|
||||
|
||||
return uriPublic;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue