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

Pranav Kant pranavk at collabora.co.uk
Thu Aug 17 15:15:29 UTC 2017


 wsd/ClientSession.cpp |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 10bfd18e973cbe4662411c449724a50c4f82faa0
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Thu Aug 17 20:03:30 2017 +0530

    Decode the headers before creating Authorization object
    
    Change-Id: I0da0b4112ac46d2407d2cd308b21ee1dee9d68de
    Reviewed-on: https://gerrit.libreoffice.org/41258
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 77e05744..6a9a88d5 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -778,13 +778,21 @@ Authorization ClientSession::getAuthorization() const
     for (auto& param: queryParams)
     {
         if (param.first == "access_token")
-            return Authorization(Authorization::Type::Token, param.second);
+        {
+            std::string decodedToken;
+            Poco::URI::decode(param.second, decodedToken);
+            return Authorization(Authorization::Type::Token, decodedToken);
+        }
     }
 
     for (auto& param: queryParams)
     {
         if (param.first == "access_header")
-            return Authorization(Authorization::Type::Header, param.second);
+        {
+            std::string decodedHeader;
+            Poco::URI::decode(param.second, decodedHeader);
+            return Authorization(Authorization::Type::Header, decodedHeader);
+        }
     }
 
     return Authorization();


More information about the Libreoffice-commits mailing list