wsd/LOOLWSD.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
New commits: commit f31095690add2fd9f76e6400621892c03b441601 Author: Jan Holesovsky <ke...@collabora.com> Date: Wed May 17 16:28:55 2017 +0200 wsd: Don't set Content-Disposition for SVGs, the browser must handle them. Otherwise the presesntation mode downloads them instead of showing. Change-Id: If2c9785aa5ef6bbb65e911b834c77ea83da281e7 Reviewed-on: https://gerrit.libreoffice.org/37715 Reviewed-by: Marco Cecchetti <mrcek...@gmail.com> Tested-by: Marco Cecchetti <mrcek...@gmail.com> diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index a889e42a..d7179ab2 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -1995,10 +1995,15 @@ private: if (filePath.isAbsolute() && File(filePath).exists()) { // Instruct browsers to download the file, not display it - response.set("Content-Disposition", "attachment; filename=\"" + fileName + "\""); + // with the exception of SVG where we need the browser to + // actually show it. + std::string contentType = getContentType(fileName); + if (contentType != "image/svg+xml") + response.set("Content-Disposition", "attachment; filename=\"" + fileName + "\""); + try { - HttpHelper::sendFile(socket, filePath.toString(), getContentType(fileName), response); + HttpHelper::sendFile(socket, filePath.toString(), contentType, response); responded = true; } catch (const Exception& exc) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits