summaryrefslogtreecommitdiffstats
path: root/wsd/FileServer.cpp
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2020-01-15 12:34:50 +0000
committerMichael Meeks <michael.meeks@collabora.com>2020-01-16 17:21:38 +0100
commit1c754d5b113c3bcb96139b4854c789df9b8ca351 (patch)
tree69a3999c4bb8a5b099bf2e6e3ded2367e1a72785 /wsd/FileServer.cpp
parentMobile: MobileWizard: Add visual indicator to mobile-wizard-content: (diff)
downloadonline-1c754d5b113c3bcb96139b4854c789df9b8ca351.tar.gz
online-1c754d5b113c3bcb96139b4854c789df9b8ca351.zip
Revert "Serve a decidedly unpretty clipboard download page"
This reverts parts of commit da455c486a5cce661cac2e214374836b2096eccc. Unfinished; also stream size calculation cannot have worked. Change-Id: I39635fe5165b82dd36095d58cfefff4920ce3a35 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86845 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'wsd/FileServer.cpp')
-rw-r--r--wsd/FileServer.cpp28
1 files changed, 4 insertions, 24 deletions
diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index 07ac439b3a..95bd54f906 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -305,9 +305,9 @@ void FileServerRequestHandler::handleRequest(const HTTPRequest& request, Poco::M
throw Poco::FileNotFoundException("Invalid URI request: [" + requestUri.toString() + "].");
const std::string loleafletHtml = config.getString("loleaflet_html", "loleaflet.html");
- if (endPoint == loleafletHtml || endPoint == "clipboard.html")
+ if (endPoint == loleafletHtml)
{
- preprocessFile(request, message, socket, endPoint);
+ preprocessFile(request, message, socket);
return;
}
@@ -588,7 +588,7 @@ constexpr char BRANDING_UNSUPPORTED[] = "branding-unsupported";
#endif
void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco::MemoryInputStream& message,
- const std::shared_ptr<StreamSocket>& socket, const std::string& endPoint)
+ const std::shared_ptr<StreamSocket>& socket)
{
const auto host = ((LOOLWSD::isSSLEnabled() || LOOLWSD::isSSLTermination()) ? "wss://" : "ws://")
+ (LOOLWSD::ServerName.empty() ? request.getHost() : LOOLWSD::ServerName);
@@ -828,27 +828,7 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco::
oss << "\r\n"
<< preprocess;
- if (endPoint == "clipboard.html")
- {
- // Handle the clipboard request.
- //FIXME: the request should contain the key to the document.
- //FIXME: get the formats and list the links in the result.
- // for (each format)
- std::ostringstream ossClipboard;
- ossClipboard <<
- "<tr>"
- " <td id=\"clipboard-formats-row\">"
- " <a href=\"downloadhtml\">Copy as HTML</a>"
- " </td>"
- "</tr>";
-
- preprocess = oss.str();
- Poco::replaceInPlace(preprocess, std::string("%CLIPBOARD_LINKS%"), ossClipboard.str());
- oss.str(preprocess);
- }
-
- preprocess = oss.str();
- socket->send(preprocess);
+ socket->send(oss.str());
LOG_DBG("Sent file: " << relPath << ": " << preprocess);
}