diff options
author | merttumer <mert.tumer@collabora.com> | 2019-08-21 16:23:40 +0300 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-10-28 10:45:04 +0100 |
commit | 1e63a02be44e005d18c257e0b408ed23d9e095a5 (patch) | |
tree | ed890fd9de4c386e7c1ad08bfb34e53bcbccf82f /wsd/FileServer.cpp | |
parent | Convert password protected test to a new-style one (diff) | |
download | online-1e63a02be44e005d18c257e0b408ed23d9e095a5.tar.gz online-1e63a02be44e005d18c257e0b408ed23d9e095a5.zip |
Added reuse cookie option for wopi client
Signed-off-by: merttumer <mert.tumer@collabora.com>
(cherry picked from commit 9b8aa96a18ce2eda11b5e51b2df5bb0d8cd822d2)
Reviewed-on: https://gerrit.libreoffice.org/78194
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 3ab7e500d83ed814a2d1ba1043df828b1b6c865f)
Change-Id: I61577189f461ef94523af13b3734d84a20a11222
Reviewed-on: https://gerrit.libreoffice.org/81557
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'wsd/FileServer.cpp')
-rw-r--r-- | wsd/FileServer.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp index 3d1766fba4..f8b650d295 100644 --- a/wsd/FileServer.cpp +++ b/wsd/FileServer.cpp @@ -693,6 +693,20 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco:: "X-XSS-Protection: 1; mode=block\r\n" "Referrer-Policy: no-referrer\r\n"; + const std::string reuseCookie = form.get("reuse_cookies_for_storage", ""); + if (reuseCookie == "true") + { + NameValueCollection cookies; + request.getCookies(cookies); + std::ostringstream cookieTokens; + + for (auto it = cookies.begin(); it != cookies.end(); it++) + { + cookieTokens << (*it).first << "=" << (*it).second << (std::next(it) != cookies.end() ? ":" : ""); + } + setenv("LOOL_REUSE_STORAGE_COOKIE", cookieTokens.str().c_str(), 1); + } + // Document signing: if endpoint URL is configured, whitelist that for // iframe purposes. std::ostringstream cspOss; |