wsd/FileServer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit d9e028e03d12265395522a8221067210b9e67817 Author: Pranav Kant <pran...@collabora.co.uk> Date: Thu May 18 22:54:44 2017 +0530 wsd: Echo back port number in CSP too if found in Referer header Otherwise, WOPI implementations that use non-standard ports get CSP voilation errors in the browsers because Poco's URI::getHost() method strips the port number from the host. No harm in mentioning the port number always even if its a standard one, so always use Poco::URI::getPort() to append the port to the frame ancestor. Change-Id: I9e7a7021b38f717e14af3d389e30f24ecaf6d122 (cherry picked from commit 4ef373ce5faa0c133239aa6704c5d16e9db89229) Reviewed-on: https://gerrit.libreoffice.org/37786 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp index 7a78562d..db7a38e3 100644 --- a/wsd/FileServer.cpp +++ b/wsd/FileServer.cpp @@ -379,7 +379,8 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco:: Poco::URI uriFrameAncestor(frameAncestor); if (!frameAncestor.empty() && !uriFrameAncestor.getScheme().empty() && !uriFrameAncestor.getHost().empty()) { - frameAncestor = uriFrameAncestor.getScheme() + "://" + uriFrameAncestor.getHost(); + frameAncestor = uriFrameAncestor.getScheme() + "://" + uriFrameAncestor.getHost() + ":" + std::to_string(uriFrameAncestor.getPort()); + LOG_TRC("Final frame ancestor: " << frameAncestor); // Replaced by frame-ancestors in CSP but some oldies don't know about that _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits