[Libreoffice-commits] online.git: loolwsd/favicon.ico loolwsd/LOOLWSD.cpp loolwsd/loolwsd.spec.in loolwsd/Makefile.am
Andras Timar
andras.timar at collabora.com
Fri Aug 26 11:12:48 UTC 2016
loolwsd/LOOLWSD.cpp | 12 ++++++++++++
loolwsd/Makefile.am | 2 ++
loolwsd/favicon.ico |binary
loolwsd/loolwsd.spec.in | 1 +
4 files changed, 15 insertions(+)
New commits:
commit 619ddb4c2f06bcd22e69f4498dc4730a5e1d2eed
Author: Andras Timar <andras.timar at collabora.com>
Date: Fri Aug 26 12:57:33 2016 +0200
loolwsd: add favicon
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 0d0c80a..828c014 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -875,6 +875,18 @@ public:
bool responded = false;
try
{
+ if (request.getMethod() == HTTPRequest::HTTP_GET && request.getURI() == "/favicon.ico")
+ {
+ std::string mimeType = "image/vnd.microsoft.icon";
+ std::string faviconPath = Path(Application::instance().commandPath()).parent().toString() + "favicon.ico";
+ if (!File(faviconPath).exists())
+ {
+ faviconPath = LOOLWSD_DATADIR "/favicon.ico";
+ }
+ response.setContentType(mimeType);
+ response.sendFile(faviconPath, mimeType);
+ responded = true;
+ }
if (request.getMethod() == HTTPRequest::HTTP_GET && request.getURI() == "/hosting/discovery")
{
// http://server/hosting/discovery
diff --git a/loolwsd/Makefile.am b/loolwsd/Makefile.am
index 4f36078..ef8c794 100644
--- a/loolwsd/Makefile.am
+++ b/loolwsd/Makefile.am
@@ -9,6 +9,7 @@ dist_bin_SCRIPTS = loolwsd-systemplate-setup
loolwsddatadir = @LOOLWSD_DATADIR@
loolwsddata_DATA = discovery.xml \
+ favicon.ico \
robots.txt
loolwsdconfigdir = @LOOLWSD_CONFIGDIR@
@@ -118,6 +119,7 @@ noinst_HEADERS = Admin.hpp \
security.h
EXTRA_DIST = discovery.xml \
+ favicon.ico \
loolwsd.xml.in \
loolwsd.service \
robots.txt \
diff --git a/loolwsd/favicon.ico b/loolwsd/favicon.ico
new file mode 100644
index 0000000..10c0557
Binary files /dev/null and b/loolwsd/favicon.ico differ
diff --git a/loolwsd/loolwsd.spec.in b/loolwsd/loolwsd.spec.in
index 3814682..f444cce 100644
--- a/loolwsd/loolwsd.spec.in
+++ b/loolwsd/loolwsd.spec.in
@@ -103,6 +103,7 @@ tar cf - . | (cd %{buildroot}/usr/share/loolwsd/loleaflet && tar xf -)
/usr/bin/loolmount
/usr/bin/looltool
/usr/share/loolwsd/discovery.xml
+/usr/share/loolwsd/favicon.ico
/usr/share/loolwsd/robots.txt
/usr/share/loolwsd/loleaflet
%{_unitdir}/loolwsd.service
More information about the Libreoffice-commits
mailing list