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

Pranav Kant pranavk at collabora.co.uk
Mon Jun 26 10:33:06 UTC 2017


 wsd/DocumentBroker.cpp |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit a03f69a16a05aba90de600f0f92e2b89af2bf591
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Thu Jun 22 17:04:59 2017 +0530

    Update PostMessageOrigin if SSL termination is on too
    
    Change-Id: I887ab368fec62a5efefde4da3762c47dd0bf66d7
    Reviewed-on: https://gerrit.libreoffice.org/39100
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 4adfcd89..3be3375c 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -445,6 +445,14 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
         Object::Ptr wopiInfo = new Object();
         if (!wopifileinfo->_postMessageOrigin.empty())
         {
+            // Update the scheme to https if ssl or ssl termination is on
+            if (wopifileinfo->_postMessageOrigin.substr(0, 7) == "http://" &&
+                (LOOLWSD::isSSLEnabled() || LOOLWSD::isSSLTermination()))
+            {
+                wopifileinfo->_postMessageOrigin.replace(0, 4, "https");
+                LOG_DBG("Updating PostMessageOrgin scheme to HTTPS. Updated origin is [" << wopifileinfo->_postMessageOrigin << "].");
+            }
+
             wopiInfo->set("PostMessageOrigin", wopifileinfo->_postMessageOrigin);
         }
 


More information about the Libreoffice-commits mailing list