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

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 11 18:41:54 UTC 2020


 wsd/RequestDetails.cpp |   30 +++++++++++++++++-------------
 wsd/RequestDetails.hpp |    2 ++
 2 files changed, 19 insertions(+), 13 deletions(-)

New commits:
commit 9928143e05099dc968a22b216aa59a60a2e16ab5
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Jun 5 11:19:58 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Thu Jun 11 20:41:36 2020 +0200

    android: fix invalid URI when running x86_64
    
    Change-Id: If057df24de63759d3e239475ecca94f8faaa0d35
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95611
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/wsd/RequestDetails.cpp b/wsd/RequestDetails.cpp
index f89745abb..9caf03f29 100644
--- a/wsd/RequestDetails.cpp
+++ b/wsd/RequestDetails.cpp
@@ -68,6 +68,23 @@ RequestDetails::RequestDetails(Poco::Net::HTTPRequest &request, const std::strin
 	_hostUntrusted = request.getHost();
 #endif
 
+    processURI();
+}
+
+RequestDetails::RequestDetails(const std::string &mobileURI)
+    : _isGet(true)
+    , _isHead(false)
+    , _isProxy(false)
+    , _isWebSocket(false)
+{
+    _isMobile = true;
+    _uriString = mobileURI;
+
+    processURI();
+}
+
+void RequestDetails::processURI()
+{
     // Poco::SyntaxException is thrown when the syntax is invalid.
     Poco::URI uri(_uriString);
     for (const auto& param : uri.getQueryParameters())
@@ -179,17 +196,4 @@ RequestDetails::RequestDetails(Poco::Net::HTTPRequest &request, const std::strin
     }
 }
 
-RequestDetails::RequestDetails(const std::string &mobileURI)
-    : _isGet(true)
-    , _isHead(false)
-    , _isProxy(false)
-    , _isWebSocket(false)
-{
-    _isMobile = true;
-    _uriString = mobileURI;
-    // Not sure if these are correct in the case of file names that need URI-encoding.
-    _fields[Field::LegacyDocumentURI] = _uriString;
-    _fields[Field::DocumentURI] = _uriString;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/RequestDetails.hpp b/wsd/RequestDetails.hpp
index 695db11cc..e55f28535 100644
--- a/wsd/RequestDetails.hpp
+++ b/wsd/RequestDetails.hpp
@@ -120,6 +120,8 @@ private:
     std::map<std::string, std::string> _params;
     std::map<Field, std::string> _fields;
 
+    void processURI();
+
 public:
 
     RequestDetails(Poco::Net::HTTPRequest &request, const std::string& serviceRoot);


More information about the Libreoffice-commits mailing list