[Libreoffice-commits] online.git: wsd/FileServer.cpp

Andras Timar andras.timar at collabora.com
Mon Dec 12 18:28:59 UTC 2016


 wsd/FileServer.cpp |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 708f9be23ad7460b8cf0459d03494aaf538bb808
Author: Andras Timar <andras.timar at collabora.com>
Date:   Mon Dec 12 19:28:37 2016 +0100

    wsd: do not log error, when access_token_ttl is not passed

diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index 1c9ba47..3d64847 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -237,13 +237,20 @@ void FileServerRequestHandler::preprocessFile(HTTPServerRequest& request, HTTPSe
     Poco::URI::encode(accessToken, "'", escapedAccessToken);
 
     unsigned long tokenTtl = 0;
-    try
+    if (accessTokenTtl != "")
     {
-        tokenTtl = std::stoul(accessTokenTtl);
+        try
+        {
+            tokenTtl = std::stoul(accessTokenTtl);
+        }
+        catch(const std::exception& exc)
+        {
+            LOG_ERR("access_token_ttl must be a unix timestamp of when token will expire");
+        }
     }
-    catch(const std::exception& exc)
+    else
     {
-        LOG_ERR("access_token_ttl must be a unix timestamp of when token will expire");
+        LOG_WRN("WOPI host did not pass access_token_ttl");
     }
 
     Poco::replaceInPlace(preprocess, std::string("%ACCESS_TOKEN%"), escapedAccessToken);


More information about the Libreoffice-commits mailing list