[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp
Henry Castro
hcastro at collabora.com
Wed Mar 16 20:46:10 UTC 2016
loolwsd/LOOLWSD.cpp | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
New commits:
commit ad980bee0217cf4e49962e1e8baa876afd99033f
Author: Henry Castro <hcastro at collabora.com>
Date: Wed Mar 16 16:45:20 2016 -0400
loolwsd: read WOPI scheme, hostname from config values
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 2c47456..23db1d3 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -629,17 +629,21 @@ private:
}
}
- void handleGetDiscovery(HTTPServerRequest& request, HTTPServerResponse& response)
+ void handleGetDiscovery(HTTPServerResponse& response)
{
DOMParser parser;
DOMWriter writer;
- URI uri("http", request.getHost(), request.getURI());
- const std::string discoveryPath = Path(Application::instance().commandPath()).parent().toString() + "discovery.xml";
+ LOOLWSD& appSrv = static_cast<LOOLWSD&>(Application::instance());
+ const std::string discoveryPath = Path(appSrv.commandPath()).parent().toString() + "discovery.xml";
const std::string mediaType = "text/xml";
const std::string action = "action";
const std::string urlsrc = "urlsrc";
- const std::string uriValue = "http://" + uri.getHost() + LOLEAFLET_PATH;
+ const std::string uriValue = appSrv.config().getString("loolwsd.wopi.scheme", "http") + "://" +
+ appSrv.config().getString("loolwsd.wopi.hostname", "localhost") +
+ // TODO. LOOLWSD does not serve loleaflet.html, so set default 80
+ //appSrv.config().getString("loolwsd.wopi.port", "9980") +
+ LOLEAFLET_PATH;
InputSource inputSrc(discoveryPath);
AutoPtr<Poco::XML::Document> docXML = parser.parse(&inputSrc);
@@ -679,7 +683,7 @@ public:
if (request.getMethod() == HTTPRequest::HTTP_GET && request.getURI() == "/hosting/discovery")
{
// http://server/hosting/discovery
- handleGetDiscovery(request, response);
+ handleGetDiscovery(response);
}
else if (!(request.find("Upgrade") != request.end() && Poco::icompare(request["Upgrade"], "websocket") == 0))
{
More information about the Libreoffice-commits
mailing list