[Libreoffice-commits] online.git: loolwsd/Storage.hpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Wed Mar 9 02:37:10 UTC 2016


 loolwsd/Storage.hpp |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit cef1d842f9229c845da1530840cfaba442763030
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Tue Mar 8 20:35:16 2016 -0500

    loolwsd: added user-agent and response header logging to WOPI GetFile
    
    Change-Id: Ia7fba845d67b27c25accb8515a44c57eed112a9b
    Reviewed-on: https://gerrit.libreoffice.org/23054
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/Storage.hpp b/loolwsd/Storage.hpp
index 5dadb9d..bb9a4d0 100644
--- a/loolwsd/Storage.hpp
+++ b/loolwsd/Storage.hpp
@@ -136,10 +136,23 @@ public:
         Poco::URI uriObject(uri);
         Poco::Net::HTTPClientSession session(uriObject.getHost(), uriObject.getPort());
         Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, uriObject.getPathAndQuery(), Poco::Net::HTTPMessage::HTTP_1_1);
+        request.set("User-Agent", "LOOLWSD WOPI Agent");
         session.sendRequest(request);
+
         Poco::Net::HTTPResponse response;
         std::istream& rs = session.receiveResponse(response);
-        Log::info() << "WOPI::GetFile Status: " <<  response.getStatus() << " " << response.getReason() << Log::end;
+
+        Log::info() << "WOPI::GetFile Status for URI [" << uri << "]: "
+                    << response.getStatus() << " " << response.getReason() << Log::end;
+
+        auto logger = Log::debug();
+        logger << "WOPI::GetFile header for URI [" << uri << "]:\n";
+        for (auto& pair : response)
+        {
+            logger << '\t' + pair.first + ": " + pair.second << '\n';
+        }
+
+        logger << Log::end;
 
         //TODO: Get proper filename.
         const auto filename = "filename";


More information about the Libreoffice-commits mailing list