[Libreoffice-commits] online.git: Branch 'feature/proxyhack' - loleaflet/js wsd/LOOLWSD.cpp

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Sat Apr 18 20:26:24 UTC 2020


 loleaflet/js/global.js |    2 +-
 wsd/LOOLWSD.cpp        |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit fb2bb71082bf7389379b041b106c3194396fc36c
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Sat Apr 18 21:24:41 2020 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Apr 18 21:24:41 2020 +0100

    Proxy: adapt the path with a serial for each request.
    
    Helps to debug, and avoids the webserver getting unhappy.
    
    Change-Id: I632550f2ad26eef973cd036422f9f1a73d0f0764

diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index bf37b6cdf..ad3632199 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -334,7 +334,7 @@
 		};
 		this.getEndPoint = function(type) {
 			var base = this.uri;
-			return base.replace(/^ws/, 'http') + '/' + type;
+			return base.replace(/^ws/, 'http') + '/' + type + '/' + this.outSerial;
 		};
 		console.debug('proxy: new socket ' + this.id + ' ' + this.uri);
 
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 541640608..49e88dbc0 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2329,8 +2329,8 @@ private:
 //                    Util::dumpHex(std::cerr, "clipboard:\n", "", socket->getInBuffer()); // lots of data ...
                     handleClipboardRequest(request, message, disposition);
                 }
-                else if (request.has("ProxyPrefix") && reqPathTokens.count() > 2 &&
-                         (reqPathTokens[reqPathTokens.count()-2] == "ws"))
+                else if (request.has("ProxyPrefix") && reqPathTokens.count() > 3 &&
+                         (reqPathTokens[reqPathTokens.count()-3] == "ws"))
                 {
                     std::string decodedUri; // WOPISrc
                     Poco::URI::decode(reqPathTokens[1], decodedUri);


More information about the Libreoffice-commits mailing list